es处理yellow状态的异常分片

2022-10-09  本文已影响0人  大鹏一怒乘风起

获取异常分片的索引列表:
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;

上一篇 下一篇

猜你喜欢

热点阅读