# Restart Elasticsearch Instance one at a time

**URL:** <https://discuss.elastic.co/t/restart-elasticsearch-instance-one-at-a-time/376344>\
**Category:** Elasticsearch\
**Created:** [March 24, 2025, 6:24pm UTC](https://discuss.elastic.co/t/restart-elasticsearch-instance-one-at-a-time/376344 "2025-03-24T18:24:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [March 24, 2025, 6:24pm UTC](https://discuss.elastic.co/t/restart-elasticsearch-instance-one-at-a-time/376344/1 "2025-03-24T18:24:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)\
**Post date:** [March 25, 2025, 12:17am UTC](https://discuss.elastic.co/t/restart-elasticsearch-instance-one-at-a-time/376344/2 "2025-03-25T00:17:17Z")

</div>

It's a [rolling restart](https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-cluster.html#restart-cluster-rolling) 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:

> <https://gist.github.com/labrown/5341ebec47bfba6dd7d4>

---

<div class="post-metadata">

**Author:** ![Aniket\_Pant](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Aniket\_Pant](https://discuss.elastic.co/u/Aniket_Pant)\
**Post date:** [March 25, 2025, 4:18am UTC](https://discuss.elastic.co/t/restart-elasticsearch-instance-one-at-a-time/376344/3 "2025-03-25T04:18:26Z")

</div>

Thanks and I will test this

---

<div class="post-metadata">

**Author:** ![Musab\_Dogan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/musab_dogan/32/70691_2.png) [@Musab\_Dogan](https://discuss.elastic.co/u/Musab_Dogan)\
**Post date:** [March 28, 2025, 11:24pm UTC](https://discuss.elastic.co/t/restart-elasticsearch-instance-one-at-a-time/376344/4 "2025-03-28T23:24:04Z")

</div>

Sure, please let us know how it goes.
