OS:Centos7x虚拟机 1H2G
jdk:1.8
elasticsearch:5.6.0

1、下载“elasticsearch-5.6.0.tar.gz”解压到/usr/local/elasticsearch目录下。

2、启动elasticSearch

这里需要注意的是,es 规定 root 用户不能启动 es,所以需要创建一个用户来启动 es

# 创建用户名为 es 的用户
useradd es
# 设置 es 用户的密码
passwd es # 创建 es 的 data 和 logs 目录
mkdir elasticsearch-5.6./data
mkdir elasticsearch-5.6./logs # 将 /usr/local/elasticsearch/elasticsearch-5.6. 的拥有者设置为 es
chown -R es:es /usr/local/elasticsearch/elasticsearch-5.6.

编辑配置文件config/elasticsearch.yml

network.host: 你自己的服务器ip
http.port:

切换到 es 用户,启动 es

su es

# -d是后台启动,第一次不建议后台启动,前台启动可以直观的看到日志信息
bin/elasticsearch -d

可能遇到的错误:

问题:

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

解决方法:

#切换到root用户修改
vim /etc/security/limits.conf # 在最后面追加下面内容
es hard nofile
es soft nofile

修改后重新登录 es 用户,使用如下命令查看是否修改成功

ulimit -Hn

问题:

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法 提高vm.max_map_count 的大小

# 切换到root用户
vim /etc/sysctl.conf
# 在最后面追加下面内容
vm.max_map_count=
# 使用 sysctl -p 查看修改后的结果
sysctl -p

问题:

Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)

解决方法:

# 由于elasticsearch5.0默认分配jvm空间大小为2g,修改jvm空间分配
# 如果使用虚拟机安装,内存最好不小于2G
# vim config/jvm.options
-Xms512m
-Xmx512m

在阿里云上可能出现的问题:

system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

解决方法:在es配置中加入下面命令即可

bootstrap.system_call_filter: false

在确定服务器端口(9200)开启,elasticsearch启动的情况下(ps -ef | grep elasticsearch)可以在浏览器中访问

3、关闭elasticSearch

# 找到elasticsearch的进程号
jps | grep Elasticsearch
Elasticsearch kill -

技术交流群:576269252

------------------------------------------
声明: 原创文章,未经允许,禁止转载!
------------------------------------------

最新文章

  1. git分支管理一
  2. 【转】图文详解YUV420数据格式
  3. createDocumentFragment() 创建文档碎片节点
  4. hibernate学习(3)——api详解对象(2)
  5. USACO section1.2 Miking cows
  6. postgresql 触发器
  7. WPF中ListBox控件选择多个数据项
  8. POPTEST老李谈钩子
  9. ABAP开发人员未来应该学些什么
  10. Linux指令--wc
  11. C#工具:Bootstrap WPF Style,Bootstrap风格的WPF样式
  12. MySQL 对分组后的同类数据进行拼接字符串
  13. PHP安装Commposer
  14. deepin安装Python3.6和pip
  15. Item的anchors属性
  16. PostgreSQL的配置文件
  17. DevOps安装、部署持续集成
  18. zookeeper 单机版配置
  19. 基于at91sam9g10的工控板
  20. 华硕笔记本开机直接进入bios解决方法

热门文章

  1. MySQL批量修改表前缀
  2. Javascript php 异常捕获
  3. hdu-4300(字符串hash)
  4. Java数组的初始化
  5. flask 知识积累
  6. 安装docker跨主机网络flannel
  7. jmeter读取csv文件
  8. 1.8.2suspend与resume方法的缺点-独占
  9. 在aliyun遇到一些问题
  10. 第75讲:模式匹配下的For循环