Elasticsearch启动报错解决方法
1、机器内剩余内存较少,会启动失败,并且有类似如下报错:
Java HotSpot(TM) 64-Bit Server VM warning:INFO: os::commit_memory(0x000000008a660000, 1973026816, 0) failed; error='Cannot allocate memory' (errno=12)
这是因为es的jvm参数-Xmx和-Xms默认都为2G
修改config下的jvm.option文件
# vi elasticsearch/elasticsearch-6.1.0/config/jvm.opstions
将
-Xms2g
-Xmx2g
改为
-Xms1g
-Xmx1g
或更小
-Xms512M
-Xmx512M
再次启动即可
2、启动的时候出现:
1、ERROR: bootstrap checks failed system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk...
解决方法:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
3、ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
解决方法:切换到root用户,编辑limits.conf 添加类似如下内容
#vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
4、max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
解决方法:切换到root用户,进入limits.d目录下修改配置文件。
#vi /etc/security/limits.d/90-nproc.conf
修改如下内容:
* soft nproc 1024
修改为
* soft nproc 2048
5、max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决方法:切换到root用户修改配置sysctl.conf
#vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
#sysctl -p
然后,再启动elasticsearch,即可启动成功。
报错[seci-*****] creating index,cause[api],templates[],shards[5]/[1],mappings[]
[seci-*****/********]create_create_mapping
解决方法:
#vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
这个文件的最后两行,把上面这个配置覆盖了。删掉最后两行即可
正确文件:
若有收获,就点个赞吧