Restart Elasticsearch Instance one at a time

Hi Team,

I want to discuss one issue that Every month we have OS patching. The team will apply patches at server level and they asked application team to stop their application so that they can go for reboot activity one at a time.

I have 17 nodes of Elasticsearch cluster(on-premise running on VMs) consists of master , data and coordinate node.

It is a time consuming when OS reboot application will comes up and i have to wait for shard allocation or when the health is green.

Is there any alternative way or script that team will take reboot one node at time and no application team required to look the health

It's a rolling restart operation. Before each node/VMs restart you should make sure the cluster health is GREEN. You can use GET /_cat/health API call in a script to check the cluster health and write a script for automation.

You can take a look at the following example:

Thanks and I will test this

Sure, please let us know how it goes.