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
解决办法
放开elasticsearch.yml中的cluster.initial_master_nodes注释,后面参数配置用到的节点名称
cluster.initial_master_nodes: [“node-1”]
2.报错【2】
java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
错误原因:
Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动。
解决办法:
在所有节点的elasticsearch.yml配置文件中加入:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
3.报错【3】
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量
ulimit -Hn
ulimit -Sn
修改/etc/security/limits.conf文件,增加配置,用户退出后重新登录生效
* soft nofile 65536
* hard nofile 65536
4.报错【4】
max number of threads [1024] for user [elasticsearch] is too low, increase to at least [4096]
最大线程个数太低,可通过下面2个命令查看当前数量
ulimit -Hu
ulimit -Su
修改配置文件/etc/security/limits.conf,增加配置
* soft nproc 4096
* hard nproc 4096
修改配置文件/etc/security/limits.d/90-nproc.conf,修改配置,用户退出后重新登录生效
* soft nproc 4096
root soft nproc unlimited
5.报错【5】
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改/etc/sysctl.conf文件,增加配置
vm.max_map_count=655360
执行以下命令生效
sysctl -p
6.报错【6】
Exception in thread “main” java.nio.file.AccessDeniedException: /opt/elasticsearch/elasticsearch-7.6.2/config/jvm.options
elasticsearch用户没有使用该文件夹的权限,执行命令
chown elasticsearch.elasticsearch /opt/elasticsearch -R
大家可根据自己定义的用户和路径更改命令