es索引状态red和yellow处理

索引状态为yellow yellow表示存在副本分片未分配。 curl -H "Content-Type: application/json" -XPUT 'http://localhost:9200/_settings' -d ' { "index" : { "number_of_replicas" : 0 } }' 再次查看状态 curl http://localhost:9200/_cat/indices?v 索引状态为red red状态表示存在主分片未分配到任一节点通过以下命令分配节点。 curl -H "Content-Type: application/json" -XPOST 'http://localhost:9200//_cluster/reroute' -d ' { "commands":[ { "allocate_stale_primary":{ "index":"索引名称". "shard"