Elasticsearch 集群 Yellow
集群健康状态为 yellow,主分片可用但副本未分配;写入和查询可能正常,但可靠性下降,节点故障时可能丢数据。
curl -s 'http://es:9200/_cluster/health?pretty'
curl -s 'http://es:9200/_cat/shards?v' | grep UNASSIGNED
curl -s 'http://es:9200/_cluster/allocation/explain?pretty'
查看节点和磁盘:
curl -s 'http://es:9200/_cat/nodes?v'
curl -s 'http://es:9200/_cat/allocation?v'
cluster.routing.allocation.* 设置。number_of_replicas: 0。_cluster/health 变为 green。ilm — 索引生命周期合上页面,先回答,再展开对照。
yellow 具体表示什么?number_of_replicas: 0。_cluster/allocation/explain 获取具体原因,并用 _cat/allocation 看磁盘水位;磁盘超过阈值时分片无法分配,需要清理磁盘、删除旧索引或扩容。
小程序版
微信扫码,随时查命令