ElasticSearch 5.0.0 安装部署常见错误或问题
问题一:
1 2 3 | [2016-11-06T16:27:21,712][WARN ][o.e.b.JNANatives ] unable to install syscall filter: Java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMPandCONFIG_SECCOMP_FILTERcompiledinatorg.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:349) ~[elasticsearch-5.0.0.jar:5.0.0] at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:630) ~[elasticsearch-5.0.0.jar:5.0.0] |
原因:报了一大串错误,大家不必惊慌,其实只是一个警告,主要是因为你Linux版本过低造成的。
解决方案:
1、重新安装新版本的Linux系统
2、警告不影响使用,可以忽略
问题二:
1 2 | ERROR: bootstrap checks failed max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536] |
原因:无法创建本地文件问题,用户最大可创建文件数太小
解决方案:
切换到root用户,编辑limits.conf配置文件, 添加类似如下内容:
1 2 3 4 5 6 | vi /etc/security/limits .conf 添加如下内容: * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096 |
备注:* 代表Linux所有用户名称(比如 hadoop)
保存、退出、重新登录才可生效
问题三:
1 | max number of threads [1024] for user [es] likely too low, increase to at least [2048] |
原因:无法创建本地线程问题,用户最大可创建线程数太小
解决方案:
切换到root用户,进入limits.d目录下,修改90-nproc.conf 配置文件。
1 2 3 4 5 | vi /etc/security/limits .d /90-nproc .conf 找到如下内容: * soft nproc 1024 #修改为 * soft nproc 2048 |
问题四:
1 | max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144] |
原因:最大虚拟内存太小
解决方案:切换到root用户下,修改配置文件sysctl.conf
1 2 3 4 5 | vi /etc/sysctl .conf 添加下面配置: vm.max_map_count=655360 并执行命令: sysctl -p |
然后重新启动elasticsearch,即可启动成功。
问题五:
1 | ElasticSearch启动找不到主机或路由 |
原因:ElasticSearch 单播配置有问题
解决方案:
检查ElasticSearch中的配置文件
1 2 3 | vi config /elasticsearch .yml 找到如下配置: discovery.zen. ping .unicast.hosts:[ "192.168.**.**:9300" , "192.168.**.**:9300" ] |
一般情况下,是这里配置有问题,注意书写格式
问题六:
1 | org.elasticsearch.transport.RemoteTransportException: Failed to deserialize exception response from stream |
原因:ElasticSearch节点之间的jdk版本不一致
解决方案:ElasticSearch集群统一jdk环境
问题七:
1 | Unsupported major.minor version 52.0 |
原因:jdk版本问题太低
解决方案:更换jdk版本,ElasticSearch5.0.0支持jdk1.8.0
问题八:
1 2 | bin /elasticsearch-plugin install license ERROR: Unknown plugin license |
原因:ElasticSearch5.0.0以后插件命令已经改变
解决方案:使用最新命令安装所有插件
1 | bin /elasticsearch-plugin install x-pack |
memory locking requested for elasticsearch process but memory is not locked
配置了bootstrap.memory_lock:true
https://www.elastic.co/guide/en/elasticsearch/reference/current/_memory_lock_check.html
max number of threads [1024] for user [admin] is too low, increase to at least [2048]
ulimit -u 2048
nproc –>/etc/security/limits.conf
https://www.elastic.co/guide/en/elasticsearch/reference/master/max-number-of-threads.html
[WARN ][o.e.b.JNANatives ] unable to install syscall filter:
Java.lang.UnsupportedOperationException:
seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and
CONFIG_SECCOMP_FILTER compiled in
常见异常
注意:yml配置文件的值前有一个空格隔开
max number of threads [1024] for user [admin] is too low, increase to at least [2048]
原因:用户允许最大线程数首先
vi bin/elasticsearch
ulimit -u 2048 //仅供测试使用
Warning: Ignoring JAVA_OPTS=…….
Please pass JVM parameters via ES_JAVA_OPTS instead
vi bin/elasticsearch
添加如下配置项:
JAVA_HOME=”/export/servers/jdk1.8.0_60”
JAVA_OPTS=”“
JAVA_OPTS配置为空,是为了不受系统配置的环境变量的影响
can not run elasticsearch as root
不能以root用户启动ES服务器。非要以root用户运行?
配置 -Des.insecure.allow.root=true
对于5.X,在config/jvm.options配置文件中,添加-Des.insecure.allow.root=true
内存锁定:
解决方法1:配置 config/elasticsearch.yml ,注释掉以下内容
#bootstrap.memory_lock: true
解决方法2:配置:/etc/security/limits.conf,
admin soft memlock unlimited
admin hard memlock unlimited
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
Your kernel does not support seccomp.
Elasticsearch attempts to utilize seccomp by default (via the setting bootstrap.system_call_filter).
Starting in 5.2.0, if you’re in production mode,
bootstrap.system_call_filter is enabled, and initializing seccomp fails,
then Elasticsearch will refuse to bootstrap.
You either have to migrate to a kernel that supports seccomp, or disable bootstrap.system_call_filter.
Centos6不支持SecComp,而ES5.2.0默认bootstrap.system_call_filter为true
禁用:在elasticsearch.yml中配置bootstrap.system_call_filter为false,注意要在Memory下面:
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
配置IP和http端口,TCP端口默认在HTTP端口上加100
network.host: 192.168.179.20
http.port: 9201
path.conf is not a recognized option
之前的配置: –path.conf=E{ES_CONF}
unknown setting [path.plugins]
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_plugins.html#_custom_plugins_path
specify a custom plugins path via path.plugins has been removed.
node settings must not contain any index level settings
Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.
curl -XPUT ‘http://localhost:9200/_all/_settings?preserve_existing=true’ -d ‘{
“index.number_of_shards” : “3”
}’
curl -XPUT ‘http://localhost:9200/_all/_settings?preserve_existing=true’ -d ‘{
“index.mapper.dynamic” : “false”,
“index.translog.durability” : “async”,
“index.translog.sync_interval” : “30s”
}’
即以index开头的配置删除。
unknown setting [bootstrap.mlockall]
修改为: bootstrap.memory_lock: true
unknown setting [action.disable_delete_all_indices]
新配置:action.destructive_requires_name: true
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具