ES状态为yellow的处理

Elasticsearch health status 显示为 yellow 解决方法

查看 health curl -XGET “ http://localhost:9200/_cluster/health?pretty=true” 返回:

{ “cluster_name” : “elasticsearch”, “status” : “yellow”, “timed_out” : false, “number_of_nodes” : 1, “number_of_data_nodes” : 1, “active_primary_shards” : 6, “active_shards” : 6, “relocating_shards” : 0, “initializing_shards” : 0, “unassigned_shards” : 2, “delayed_unassigned_shards” : 0, “number_of_pending_tasks” : 0, “number_of_in_flight_fetch” : 0, “task_max_waiting_in_queue_millis” : 0, “active_shards_percent_as_number” : 75.0 } 查看索引状态 curl -XGET “ http://localhost:9200/_cat/indices?v” 返回:

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size yellow open megacorp Cd6ahzdvSiScOyrYRzYA9g 1 1 4 0 21.9kb 21.9kb yellow open my_index C3BkK5ACTI2EQvjIkqXXng 1 1 7 0 12.1kb 12.1kb 设置所有副本(rep)个数为 0 curl -XPUT “ http://localhost:9200/_settings” -H ‘Content-Type: application/json’ -d’ { “index” : { “number_of_replicas” : 0 } }’ 再次查看索引状态:显示为 green。

设置单个副本个数为 0 curl -XPUT “ http://localhost:9200/my_index/_settings” -H ‘Content-Type: application/json’ -d’ { “index” : { “number_of_replicas” : 1 } }’


ES 状态为 yellow 的处理 https://blog.51cto.com/weimouren/2483363 Img

Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up