curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "none"}}'
/etc/init.d/elasticsearch restart
curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.enable": "all"}}'
curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.disable_allocation": true}}'
/etc/init.d/elasticsearch restart
curl -XPUT localhost:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.disable_allocation": false}}'
分片保持未分配状态,直到“ cluster.routing.allocation.disable_allocation”:false,然后在刚刚重启的服务器上恢复分片(以关闭前的大小开始)。这非常快。
参考:http ://elasticsearch-users.115913.n3.nabble.com/quick-recovery-after-node-restart- in-elasticsearch-td4033876.html#a4034211