你一定觉得很诧异,我都调优做好了为什么还是报错呢?比如:
1.[4096] for elasticsearch process is too low, increase to at least [65536]。。。。。。
在文件/etc/security/limits.conf末尾增加:
sudo vim /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536
* soft nproc 2048
* hard nproc 4096
- memlock unlimited
修改完成后 把现在连接的服务都断开,再连接上就生效了 ulimit -a命令可以查看
如果还不行,以用户修改,不要root,一般生产环境服务器不会有root权限的
临时生效 ulimit -n 65536
2.max virtual memory areas vm.max_map_count [65536] is too low, increase to at least [262144]
elasticsearch用户拥有的内存权限太小,这个可能会报错
vim /etc/sysctl.conf
vm.max_map_count = 655360
sysctl –p
这个是让所有用户都可以读到如下配置文件数据,慎用
echo "* soft nofile 65535" >> /etc/security/limits.conf
echo "* hard nofile 65535" >> /etc/security/limits.conf
* 表示所用的用户