The method of prohibiting fragment movement before Elasticsearch restart
Before restarting the cluster, set the cluster to stop sharding movement:
Curl-XPUT http://localhost:9200/_cluster/settings-d'{
"transient": {
"cluster.routing.allocation.enable": "none"
}
}'
After restarting, restore the automatic allocation of shards:
Curl-XPUT http://localhost:9200/_cluster/settings-d'{
"transient": {
"cluster.routing.allocation.enable": "all"
}
}'
Reference:
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