CentOS7上elasticsearch5.0启动失败
CentOS7上elasticsearch5.0启动失败
刚一启动完直接就退出了
$ ./elasticsearch ... ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144] [2016-10-31T04:55:45,240][INFO ][o.e.n.Node ] [vJDcSkt] stopping ... [2016-10-31T04:55:45,249][INFO ][o.e.n.Node ] [vJDcSkt] stopped [2016-10-31T04:55:45,249][INFO ][o.e.n.Node ] [vJDcSkt] closing ... [2016-10-31T04:55:45,257][INFO ][o.e.n.Node ] [vJDcSkt] closed
解决办法:
问题1:max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
修改/etc/security/limits.conf文件,添加或修改如下行:
hard nofile 65536soft nofile 65536
问题2:max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
使用下面的方法临时使其生效
sudo sysctl -w vm.max_map_count=262144
或者修改 /etc/sysctl.conf 文件,添加 “vm.max_map_count”设置
设置后,可以使用
sysctl -a
max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
1 [root@localhost ~]# cat /etc/sysctl.conf | grep -v "vm.max_map_count" > /tmp/system_sysctl.conf
2 [root@localhost ~]# echo "vm.max_map_count=262144" >> /tmp/system_sysctl.conf
3 [root@localhost ~]# mv /tmp/system_sysctl.conf /etc/sysctl.conf
4 mv:是否覆盖"/etc/sysctl.conf"? y
5 [root@localhost ~]# cat /etc/sysctl.conf
6 # System default settings live in /usr/lib/sysctl.d/00-system.conf.
7 # To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
8 #
9 # For more information, see sysctl.conf(5) and sysctl.d(5).
10 vm.max_map_count=262144
11 [root@localhost ~]# sysctl -p
12 vm.max_map_count = 262144
每天一跬步,全年一大步