ERROR: [N] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
[2]: max number of threads [1024] for user [uaren] is too low, increase to at least [4096]
[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
[5]:future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/nlp/java/jdk1.8.0_162/jre] does not meet this requirement
[6]:Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: MarkedYAMLException[mapping values are not allowed here
问题描述:
1.原因: 每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量
查看 进程数
ulimit -Hn
ulimit -Sn
解决方案:
解决: [1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
# 修改 /etc/security/limits.conf配置文件
sudo vim /etc/security/limits.conf
在配置文件加上:
* hard nofile 65536
* soft nofile 65536
解决:[2]: max number of threads [1024] for user [uaren] is too low, increase to at least [4096]
# 修改 /etc/security/limits.conf配置文件
# 注意: 这里需要修改两个配置文件
sudo vim /etc/security/limits.conf
在配置文件加上:
* hard nproc 4096
* soft nproc 4096
sudo vim /etc/security/limits.d/90-nproc.conf
在配置文件加上:
* soft nproc 4096
解决:[3]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:[4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
解决[5]:future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/nlp/java/jdk1.8.0_162/jre] does not meet this requirement
#这是由于在elastic 到7.0之后 默认要使用JDK11以上 但是我们平时开发使用的一般都是JDK1.8,所以导致启动不成功
#elastic 7.2之后就自带JDK 我们可以再不改名系统本身环境变量的同时,使用elastic自身的JDK
#需要修改elastic的启动文件
vim bin/elasticsearch
#配置为elasticsearch自带jdk
export JAVA_HOME=/usr/local/nlp/elasticsearch-7.9.1/jdk
export PATH=$JAVA_HOME/bin:$PATH
#添加jdk判断
if [ -x "$JAVA_HOME/bin/java" ]; then
JAVA="/usr/local/nlp/elasticsearch-7.9.1/jdk/bin/java"
else
JAVA=`which java`
fi
解决[6]:Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: MarkedYAMLException[mapping values are not allowed here
elasticsearch错误集:ERROR: [N] bootstrap checks failed[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536][2]: max number of threads [1024] for user [uaren] is too low, increase to at least [4096][3]: max v