ES集群状态为red问题总结

2022-05-08  本文已影响0人  BarretX

线上三台集群部署的集群状态为red,持续了好几天,下面分析一下问题根源以及解决思路。

确定集群状态curl http://*:9200/_cluster/health?pretty

集群状态

确定异常索引

# 查看所有索引状态
curl -XGET "http://*:9200/_cat/indices?pretty"
# 查看异常索引状态
curl -XGET "http://*:9200/_cat/indices?v&health=red"
异常索引

查看异常索引分片分配状态curl -XGET "http://*:9200/_cat/shards/some_index_name?v"

异常索引分片分配状态

查看分片分配不成功的原因curl -XGET "http://*:9200/_cat/shards/some_index_name?v&h=n,index,shard,prirep,state,sto,sc,unassigned.reason,unassigned.details"

重新分配失败的分片curl -XPOST "http://*:9200/_cluster/reroute?retry_failed=true"

问题避免

curl -XPUT "http://*:9200/some_index_name/_settings" -d'
{
  "index": {
    "allocation": {
      "max_retries": 20
    }
  }
}'

参考资料

线上 Elasticsearch 集群健康值 red 状态问题排查与解决 - 云+社区 - 腾讯云 (tencent.com)
Elasticsearch集群异常状态(RED、YELLOW)原因分析 - 云+社区 - 腾讯云 (tencent.com)
es实战-分片分配失败解决方案_casterQ的博客-CSDN博客_es 分片失败

上一篇下一篇

猜你喜欢

热点阅读