es报错如下:
[2019-10-11T16:23:28,945][ERROR][o.e.b.Bootstrap ] [es-node-1] node validation exception[3] bootstrap checks failed
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
[2]: memory locking requested for elasticsearch process but memory is not locked
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
切换到root用户,编辑limits.conf 添加类似如下内容
vi /etc/security/limits.conf
添加如下内容: (soft nproc和hard nproc也可以设置成65536) 修改成
root soft nofile 65535
root hard nofile 65535
* soft nofile 65536
* hard nofile 65536
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
以上几个参数的解释
① soft nproc:可打开的文件描述符的最大数(软限制)
② hard nproc:可打开的文件描述符的最大数(硬限制)
③ soft nofile:单个用户可用的最大进程数量(软限制)
④ hard nofile:单个用户可用的最大进程数量(硬限制)
[2]: memory locking requested for elasticsearch process but memory is not locked
原因:锁定内存失败
解决方案:
切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:
sudo vim /etc/security/limits.conf
添加如下内容:
* soft memlock unlimited
* hard memlock unlimited
备注:* 代表Linux所有用户名称
保存、退出、重新登录才可生效
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
原因:最大虚拟内存太小
解决方案:切换到root用户下,修改配置文件sysctl.conf
sudo vim /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
参考地址:
https://www.cnblogs.com/DreamDrive/p/7853162.html
https://blog.csdn.net/Hey_WonderfulWorld/article/details/73612929