Elasticsearch 远程访问 错误

[4]bootstrap checks failed

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

查看限制

ulimit -Hn
65535

每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量

ulimit -Hn 
ulimit -Sn
vim /etc/security/limits.conf 
# End of file
root soft nofile 65535
root hard nofile 65535
* soft nofile 65536
* hard nofile 65536

[2]: max number of threads [1024] for user [gaodevops] is too low, increase to at least [2048]

vim /etc/security/limits.d/90-nproc.conf 
*          soft    nproc     2048
root       soft    nproc     unlimited

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

vim /etc/sysctl.conf 
vm.max_map_count=262144

查看

sudo sysctl -p 
sysctl -a|grep vm.max_map_count

[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,而ES5.X默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。

在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

可以查看issues https://github.com/elastic/elasticsearch/issues/22899

此文件修改后需要重新登录用户,才会生效

[2019-09-20T17:10:11,138][INFO ][o.e.n.Node ] [STU4UH-] stopping ...
[2019-09-20T17:10:11,165][INFO ][o.e.n.Node ] [STU4UH-] stopped
[2019-09-20T17:10:11,167][INFO ][o.e.n.Node ] [STU4UH-] closing ...
[2019-09-20T17:10:11,189][INFO ][o.e.n.Node ] [STU4UH-] closed

gaodevops