文章基于ElasicSearch版本:7.3.2,Linux版本:CentOS-7.7。供其他版本参考。
Caused by: org.elasticsearch.ElasticsearchException: Failure running machine learning native code.
This could be due to running on an unsupported OS or distribution, missing OS libraries, or a
problem with the temp directory. To bypass this problem by running Elasticsearch without machine
learning functionality set [xpack.ml.enabled: false].
解决措施:
vi ElasticSearch-7.3.2/config/elasticsearch.yml
编辑ElasticSearch-7.3.2\config\elasticsearch.yml文件,文件最后追加xpack.ml.enabled: false
。注意“:”号存在空格!
output:
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 3946053632 bytes for committing reserved memory.
# An error report file with more information is saved as:
# logs/hs_err_pid3518.log
error:
Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x00000006d4cc0000, 3946053632, 0)
failed; error='Cannot allocate memory' (errno=12)
解决措施:
vi ElasticSearch-7.3.2/config/jvm.options
...
-Xms4g
-Xmx4g
jvm.options中jvm内存设置偏大,启动时系统无法提供设置的内存。将ElasticSearch-7.3.2\config\jvm.options中-Xms和-Xmx参数调小,具体内存大小根据机器设定。
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
解决措施:
该用户没有启动ES权限,切换到部署ES的用户下启动即可。
main ERROR Null object returned for RollingFile in Appenders.
main ERROR Null object returned for RollingFile in Appenders.
main ERROR Unable to locate appender "rolling" for logger config "root"
main ERROR Unable to locate appender "rolling_old" for logger config "root"
解决措施:
vi ElasticSearch-7.3.2/config/log4j2.properties
...
#################################################
logger.deprecation.name = org.elasticsearch.deprecation
logger.deprecation.level = warn
将ElasticSearch-7.3.2\config\log4j2.properties文件中,logger.deprecation.level = warn
改为error。
ERROR: [1] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
解决措施:
vi /etc/security/limits.conf
...
* soft nofile 65536
* hard nofile 65536
编辑/etc/security/limits.conf,追加如上内容。此文件需root权限修改,且重新登录用户后才会生效。
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决措施:
vi /etc/sysctl.conf
...
vm.max_map_count=655360
编辑/etc/sysctl.conf,追加如上内容。此文件需root权限修改,保存后,执行:sysctl -p
重新启动。
启动ES,出现[INFO ][o.e.n.Node ] [node-2] started
即正常启动。此时访问9200端口可查看ES详细信息。希望本文能对您有所帮助!