Quick recovery after node restart in elasticsearch

Another option is to prepare the node ahead of time by excluding it using
the shard placement API. The cluster will immediately begin moving shards
off the node until it has none left, allowing you to restart it as many
times as you want until it is ready for use again. Depending on why you
need to restart it, that may be more useful to you as it prevents your
cluster from every going into a degraded state at all.

-Pradeep

On Friday, April 26, 2013 1:25:31 AM UTC-7, Damien Hardy wrote:

My procedure to restart a node without shards reallocation is :

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

Shard keep analocated until
"cluster.routing.allocation.disable_allocation": false, then shards recover
on the server just restarted (starting at size they were before shutdown)
It is very quick.

Cheers,

--
Damien

2013/4/26 ovamsikrishna <ovamsi...@gmail.com <javascript:>>

Consider the below settings in the elasticsearch.yml

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

Current setting: Say, I have 3 data nodes. Now if I decide to restart a
data
node(due to a small change in setting), the recovery will start
immediately
after node restart as per the expected_data_nodes setting. There will be
many unassigned shards, which will get allocated slowly depending on the
data it contains.

In order to avoid that, is there any way to allocate all the unassigned
shards to a specific node?(in my case the restarted node) and once that is
done, ES should take over the rebalancing.

Mainly I want to avoid the heavy timelag of the cluster state from yellow
to
green.(it is in the range of hours in my case)

Can I use the cluster reroute api for this purpose?

or is there any other api to transfer all the unassigned shards to
specific
node at one go?

--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/quick-recovery-after-node-restart-in-elasticsearch-tp4033876.html
Sent from the Elasticsearch Users mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.