Elasticsearch重啓前禁止分片移動的方法

重啓集羣前,先設置集羣停止分片移動:

curl -XPUT http://localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "none"
}
}'

重啓之後,恢復分片自動分配:

curl -XPUT http://localhost:9200/_cluster/settings -d '{
"transient" : {
"cluster.routing.allocation.enable" : "all"
}
}'

參考:
https://blog.csdn.net/an74520/article/details/42871023
https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html#_shard_allocation_settings
https://blog.csdn.net/YxSimple/article/details/50725978

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章