ElasticSearch启动常见错误

初次接触ElasticSearch,在本机上运行没错,想着让乌班图做服务器,用自己的window做客户端访问,肯定要修改配置文件中的network.host0.0.0.0,修改后启动各种出错。

1
2
3
2020-04-03 09:41:19,822 main ERROR Null object returned for RollingFile in Appe
nders.2020-04-03 09:41:19,822 main ERROR Unable to locate appender "rolling" for logg
er config "root"

报错如上,解决方案:

修改config/log4j2.properties

logger.deprecation.level 值修改为error,重新打开终端再次启动ElasticSearch,报错变了。

错误信息如下:

1
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方案:

修改/etc/sysctl.conf文件,最后追加一条内容

1
vm.max_map_count = 655360

保存后执行 sysctl -p,再次启动成功。

其他错误信息:

1
max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

如果包以上错误,需要编辑 /etc/security/limits.conf,追加以下内容;

1
2
* soft nofile 65536
* hard nofile 65536

此文件修改后需要重新登录用户,才会生效