获取异常分片的索引列表:
curl -s -XGET localhost:9200/_cat/shards?h=index,shard,prirep,state,unassigned.reason| grep UNASSIGNED|awk '{print $1}' >1
更改异常分片数量,让集群状态green
cat 1|while read line;do curl -XPUT -H 'Content-Type: application/json' localhost:9200/$line/_settings -d '{"number_of_replicas": 0}';done;
网友评论