How do I relocate shards from a node prior to shutting it down?


(Piavlo) #1

Is it possible to relocate shards from a node before a shutdown
Does nodes shutdown api do shards relocation prior to shutting down?
http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown.html

tnx

--


(Igor Motov) #2

The _shutdown API doesn't relocate shards automatically. In a typical
scenario with at least one replica for each shard, you can simply shutdown
a node and elasticsearch will automatically allocate new shards to preserve
correct number of replicas. However, you can do it manually by updating
"cluster.routing.allocation.exclude.*" settings using Cluster Update
Settings APIhttp://www.elasticsearch.org/guide/reference/api/admin-cluster-update-settings.html.
For example, if you want to shutdown a node with id
"IdQx48TwSE-e5PI1cV-kOA", you can execute the following command prior to
shutdown:

curl -XPUT localhost:9200/_cluster/settings -d '{"transient":
{"cluster.routing.allocation.exclude._id" :"IdQx48TwSE-e5PI1cV-kOA"}}'

wait until all shards are gone from this node, and then shutdown the node.
See http://www.elasticsearch.org/guide/reference/modules/cluster.html for
more information.

On Monday, October 29, 2012 7:55:43 AM UTC-4, Piavlo wrote:

Is it possible to relocate shards from a node before a shutdown
Does nodes shutdown api do shards relocation prior to shutting down?

http://www.elasticsearch.org/guide/reference/api/admin-cluster-nodes-shutdown.html

tnx

--


(system) #3