解决 elasticsearch 启动错误 bootstrap checks failed
异常信息:
[2021-12-14T10:32:17,074][INFO ][o.e.b.BootstrapChecks ] [node-10] 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 number of threads [1024] for user [xzlawin] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /usr/local/opt/elasticsearch-7.8.0/logs/my-application.log
[2021-12-14T10:32:17,106][INFO ][o.e.n.Node ] [node-10] stopping ...
[2021-12-14T10:32:17,139][INFO ][o.e.n.Node ] [node-10] stopped
[2021-12-14T10:32:17,139][INFO ][o.e.n.Node ] [node-10] closing ...
[2021-12-14T10:32:17,160][INFO ][o.e.n.Node ] [node-10] closed
[2021-12-14T10:32:17,162][INFO ][o.e.x.m.p.NativeController] [node-10] Native controller process has stopped - no new native processes can be started
分析原因:bootstrap 校验失败
解决方法:将当前用户的软硬限制调大
- 修改配置文件,/etc/security/limits.conf
cp -a /etc/security/limits.conf /etc/security/limits.conf.bak
vi /etc/security/limits.conf
# 在文件末尾追加下面内容
xzlawin soft nofile 65536
xzlawin hard nofile 65536
- 修改配置文件,/etc/security/limits.d/90-nproc.conf
cp -a /etc/security/limits.d/90-nproc.conf /etc/security/limits.d/90-nproc.conf.bak
vi /etc/security/limits.d/90-nproc.conf
# 在文件末尾追加下面内容
xzlawin soft nofile 65536
xzlawin hard nofile 65536
* soft nproc 4096
* hard nproc 4096
# 注意:* 表示Linux所有用户名称
- 修改配置文件,/etc/sysctl.conf
cp -a /etc/sysctl.conf /etc/sysctl.conf.bak
vi /etc/sysctl.conf
# 在文件末尾追加下面内容
vm.max_map_count=655360
- 重新加载
sysctl -p
文章来源地址https://www.toymoban.com/news/detail-519699.html
文章来源:https://www.toymoban.com/news/detail-519699.html
到了这里,关于解决 elasticsearch 启动错误 bootstrap checks failed的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!