本文主要是介绍es集群重新分片报错Too many open files解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
现象
查看es集群状态
后面所有操作均在开发工具中操作, 命令行是 curl -XGET -uelastic:password http://ip:9200/_cluster/health
GET _cluster/health
查看解释
GET /_cluster/allocation/explain
查看es日志
[WARN ][o.e.c.r.a.AllocationService] [node-2] failing shard [failed shard, shard [hotel-operation-platform-points-pro-2024.08.28][2], node[nbf_TjbDQeqC3kTkcm1Ehw], [P], s[STARTED], a[id=5S3X4mw4TMCbGJR0IO35hA], message [shard failure, reason [index id[dfqXm5EBeV79l1m1taGu] origin[PRIMARY] seq#[106704]]], failure [FileSystemException[/data/elasticsearch/data/nodes/0/indices/QAWmzM4HRV6cBn9tRiJDsg/2/index/_1h_Lucene85FieldsIndexfile_pointers_1.tmp: Too many open files]], markAsStale [true]]
java.nio.file.FileSystemException: /data/elasticsearch/data/nodes/0/indices/QAWmzM4HRV6cBn9tRiJDsg/2/index/_1h_Lucene85FieldsIndexfile_pointers_1.tmp: Too many open files
查看es最大打开文件描述符及使用
GET _nodes/stats/process?filter_path=**.max_file_descriptors
GET _nodes/stats?pretty
之前open_file_descriptors的值已经非常接近设置的65536
解决
增加最大打开文件描述符
1、/etc/security/limits.conf
es soft nofile 1024000
es hard nofile 1024000
2、启动脚本添加
LimitNOFILE=1024000
LimitNPROC=1024000
3、systemctl daemon-reload
4、重启es集群(做好启master节点)
这篇关于es集群重新分片报错Too many open files解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!