**重启服务器后,突然导致启动Elasticsearch启动报错:
ERROR: [1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
解决办法:
首先备份 /etc/security/limits.conf
cp /etc/security/limits.conf /etc/security/limits.conf.bak
在root下vim /etc/security/limits.conf
修改—在文档最后加入
oracle soft core 102400
oracle hard core 102400
oracle soft nofile 10240
oracle hard nofile 65536
oracle soft nproc 2048
oracle hard nproc 16384
oracle soft stack 10204
oracle hard stack 32768
(其中oracle是用户名)
(2)使用 ulimit -a查看,发现open files 只有1024,然后输入ulimit -n 65535,再查看,如下图
注:改动后下次再重新启动就不需要再改了,但是偶尔不知道什么原因会出现一些状况,需要输入ulimit -n 65535重新设置
另外其中的65535是根据报错中的提示设置的
参考网页:
这是参考文献以及elasticsearch启动异常的一些解决办法,还有其他种异常,没遇到过,先存在这里。
https://www.cnblogs.com/linzepeng/p/12084734.html
https://blog.youkuaiyun.com/yangzhenzhen/article/details/8905846
https://blog.51cto.com/xpleaf/2327317
https://stackoverflow.com/questions/42300463/elasticsearch-bootstrap-checks-failing
https://blog.youkuaiyun.com/weixin_42233789/article/details/105177103