Fast recovery after node reboot in elasticsearch

Consider the settings below in the elasticsearch.yml file

gateway.recover_after_data_nodes: 3 gateway.recover_after_time: 5m gateway.expected_data_nodes: 3 

Current setup: Let's say I have 3 data nodes. Now, if I decide to restart the node data (due to a slight change in the settings), the recovery will begin immediately after the node is restarted in accordance with the expected_data_nodes parameter. There will be many unassigned fragments that will be distributed slowly depending on the data it contains.

To avoid this, is there a way to highlight all unassigned shards for a specific node? (node ​​is restarted in my case), and as soon as this is done, ES should take over the rebalancing.

Basically I want to avoid the heavy timeline of the cluster state from yellow to green (this is in hours in my case)

Can I use api cluster redirection for this purpose?

or is there any other api for transferring all unassigned shards to a specific node at a time?

+8
elasticsearch
source share
1 answer

For version Elasticsearch> = 1.0.0:

 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"}}' 

For an earlier version of ES:

 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}}' 

The fragment remains unallocated until "cluster.routing.allocation.disable_allocation": false, then only the restarts are restored on the server (starting from the size that they were before shutting down) This is very fast.

Link: http://elasticsearch-users.115913.n3.nabble.com/quick-recovery-after-node-restart-in-elasticsearch-td4033876.html#a4034211

+26
source share

All Articles