当前位置: 首页 > 工具软件 > Vim Bootstrap > 使用案例 >

CentOS 7 启动ElasticSearch时报错bootstrap checks failed

廉宇
2023-12-01

CentOS 7 启动ElasticSearch时报错bootstrap checks failed

错误:

[2021-01-27T11:50:22,939][INFO ][o.e.b.BootstrapChecks    ] [cnetos7.hanhua.com] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
[4]: max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
[5]: memory locking requested for elasticsearch process but memory is not locked
ERROR: Elasticsearch did not exit normally - check the logs at /usr/local/elasticsearch7/logs/elasticsearch.log

第一个问题:
max file descriptors [1024] for elasticsearch process is too low, increase to at least [4029]

解决方案:
limits.conf,追加以下内容

vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536

注:如果编辑重启启动之后还不能消除这个错误,则重登陆用户。

第二个问题:
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方案:
sysctl.conf,追加以下内容:

[root@cnetos7 elasticsearch7]# vim /etc/sysctl.conf
vm.max_map_count=262144

保存后,执行:

[root@cnetos7 elasticsearch7]# sysctl -p

重新启动,成功。

第三个问题:
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

出现错误的原因:是因为centos6.x操作系统不支持SecComp,而elasticsearch 5.5.2默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。

解决方案:
在elasticsearch.yml中添加配置项:

[root@cnetos7 config]# vim elasticsearch.yml
bootstrap.memory_lock:  false
bootstrap.system_call_filter: false

第四个问题:
max number of threads [1024] for user [wh] likely too low, increase to at least [2048]

解决方案:
修改如下内容:

[root@cnetos7 config]# vim /etc/security/limits.d/90-nproc.conf 
soft nproc 1024
#修改为
soft nproc 2048

第五个问题:
memory locking requested for elasticsearch process but memory is not locked

解决方案:
解决方法一(关闭bootstrap.memory_lock:,会影响性能):

[root@cnetos7 config]# vim /usr/local/elasticsearch7/config/elasticsearch.yml         
bootstrap.memory_lock: false

解决方法二(开启bootstrap.memory_lock:):

  1. 修改文件/usr/local/elasticsearch7/config/elasticsearch.yml
[root@cnetos7 config]# vim /usr/local/elasticsearch7/config/elasticsearch.yml
bootstrap.memory_lock: true
  1. 修改文件/etc/security/limits.conf,最后添加以下内容。
[root@cnetos7 config]#  vim  /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 32000
* hard nproc 32000
* hard memlock unlimited
* soft memlock unlimited
  1. 修改文件 /etc/systemd/system.conf ,分别修改以下内容。
[root@cnetos7 config]#  vim /etc/systemd/system.conf 
DefaultLimitNOFILE=65536
DefaultLimitNPROC=32000
DefaultLimitMEMLOCK=infinity

改好后重启下系统
注:以上问题如果编辑重启启动之后还不能消除这个错误,则重登陆用户。

 类似资料: