Linux centos6.8 安装配置elasticsearch6.3.2 亲测成功(二)
前言:
elasticsearch在linux中安装遇到过很多坑,我是郁闷的不行了,网上有很多的博客写得不全,要么就是有问题,照着上面操作,完全是错误连篇,没办法,我是装好了,为了更多的人安装elasticsearch少遇点坑,所以写了这博客,每个命令都很详细。也有截图,详细大家应该安装是没有问题了的。
ps:
请先看Linux centos6.8 安装配置elasticsearch6.3.2 亲测成功(一)。
1.通过ifconfig查询到自己的ip地址
2.编辑elasticsearch.yml配置文件
输入i,进入插入(编辑)模式。
将network.host的注释去掉,ip地址改成自己的linux的虚拟机ip地址
http.post的注释去掉,换成9200端口
ESC
:wq!保存退出
再次进入 elasticsearch安装目录的bin目录下 ./elasticsearch 启动elasticsearch,报错了
报了4个错,那接下来就去解决这4个问题。
3.解决报错
再打开一个终端。
1)报错:max file descriptors [ 4096 ] for elasticsearch process 15 too low, increase to at least [ 65536 ]
进入 etc目录下,
进入 security目录下,
需要改下面两个,不过一个是文件,一个是目录。
用 vi ./limits.conf 进入limits.conf进行编辑,修改如下:
es soft nofile 65536
es hard nofile 65536
es soft nproc 4096
es hard nproc 4096
保存退出。
2)报错:max number of threads [ 1024 ] for user [ es ] 15 too 1ow, inCrease to at least [ 4096 ]
进入limits.d目录下,修改90-nproc.conf 文件
保存退出。
3)报错:max virtual mefnory areas vm.max_ map_count [ 65530 ] 15 too low, increase toa t least [ 262144 ]
退回到etc目录下
在配置文件最后一行加上:
m.max_map_count=655360
这里干脆就改得更大一点。
4)报错:system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
问题原因:因为Centos6不支持SecComp,而ES6.32默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
解决方法:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
保存退出。
重启linux系统。
再次进入 elasticsearch安装目录的bin目录下 ./elasticsearch 启动elasticsearch
打开linux系统,使用root用户,关闭防火墙,或者你用你主机windows的浏览器无法访问到你的虚拟机linux的ip。
然后你可以用你的主机windows系统的浏览器去访问了。
验证,成功。