elasticsearch 7.X错误集史上最全的

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 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]
# 修改/etc/sysctl.conf文件,增加配置vm.max_map_count=262144

sudo vim /etc/sysctl.conf

在配置文件加上:
vm.max_map_count=262144

#保存之后 生效
sysctl -p

# 注意:增加配置,用户退出后重新登录生效
解决:[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
#打开配置文件,ip替换host1等,多节点请添加多个ip地址,单节点可写按默认来
#配置以下三者,最少其一
#[discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes]

vim config/elasticsearch.yml

在配置文件加上:
cluster.initial_master_nodes: ["node-1"] #这里的node-1为node-name配置的值

在这里插入图片描述

解决[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.yml配置文件 配置错误导致
有三种情况:
1.配置文件存在首行空格
2.配置文件带有中文空格
3.配置文件配置了同样的属性
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值