Rolling Restarts

If you have a clustered setup and require to performance maintenance or rolling restart of your nodes, please complete the following steps: This will temporarily disable shard allocation during the rolling restart process.

First disable allocation from any of the cluster nodes
curl -XPUT 'http://localhost:9200/_cluster/settings -d
{ "transient" : { "cluster.routing.allocation.enable" : "none" } } '

Now enter the folllowing command on the nodes that is being restarted
curl -XPOST 'http://localhost:9200/_cluster/nodes/_local/_shutdown'

This will put your cluster in yellow status. You can check the status by running the following command.
curl -XGET 'http://localhost:9200/_cluster/health?pretty=1'

You should see an output similar to this:
{
"cluster_name" : "EPSTACK",
"status" : "yellow",
"timed_out" : false,
.....
}


Once the node is restarted and joined back to the cluster, turn allocation back on:
curl -XPUT 'http://localhost:9200/_cluster/settings -d
{ "transient" : { "cluster.routing.allocation.enable" : "all" } } '

Now check the status of the cluster again.
curl -XGET 'http://localhost:9200/_cluster/health?pretty=1'

Once all shards are allocated, the cluster status will return to green. Wait for green status before restarting any additional nodes.

{
"cluster_name" : "EPSTACK",
"status" : "green",
"timed_out" : false,
.....
}

Was this article helpful?

Related Articles

Leave A Comment?