# How exactly do I shutdown, then restart the cluster?

**URL:** <https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622>\
**Category:** Elasticsearch\
**Created:** [April 30, 2020, 6:57pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622 "2020-04-30T18:57:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgelb](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rgelb](https://discuss.elastic.co/u/rgelb)\
**Post date:** [April 30, 2020, 6:57pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/1 "2020-04-30T18:57:42Z")

</div>

I have a cluster of 3 nodes. I need to change a setting in elasticsearch.yml and then restart the cluster. I am a bit confused on the procedure. Here is what I have so far. Is this correct?

1. Make changes to /etc/elasticsearch/elasticsearch.yml on all 3 nodes in the cluster.
2. On the master node only, run **sudo service elasticsearch restart**

Is this all there is to it? Or do I need to also run commands on the child nodes as well?

---

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [April 30, 2020, 7:02pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/2 "2020-04-30T19:02:10Z")

</div>

If you have 3 master eligible nodes you can perform a rolling restart without any outage because stopping one node at the time you will keep the quorum (2 out of 3).

The procedures are detailed at [https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-cluster.html#restart-cluster-rolling](https://www.elastic.co/guide/en/elasticsearch/reference/current/restart-cluster.html#restart-cluster-rolling)

---

<div class="post-metadata">

**Author:** ![rgelb](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rgelb](https://discuss.elastic.co/u/rgelb)\
**Post date:** [April 30, 2020, 7:04pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/3 "2020-04-30T19:04:27Z")

</div>

@Luca_Belluccini Sorry for a dumb question, how do I know if the nodes are master eligible?

And also, if I don't care about causing an outage - is the procedure I outlined above sufficient?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 30, 2020, 7:05pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/4 "2020-04-30T19:05:15Z")

</div>

There is two way you can do.  
shutdown whole cluster and restart, if you can afford stopping ingestion

execute this on all three nodes  
systemctl stop kibana  
systemctl stop logstash

then stop elasticsearch simultaniously  
systemctl stop elasticsearch

and then start in reverse.

otherwise one node at a time(rolling update). but on this procedure don't forget to disable shard reallocation for faster restaart. make sure your cluster is green before you stop/start second node.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 30, 2020, 7:08pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/5 "2020-04-30T19:08:09Z")

</div>

check on your /etc/elasticsearch/elasticsearch.yml file  
node.master: true that means it is master node

---

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [April 30, 2020, 7:13pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/6 "2020-04-30T19:13:39Z")

</div>

The link I've shared details also the full cluster restart procedure (at the top of the page).

To know if a node is master or not, check the API `GET _cat/nodes?v` and check for the column `r` or `node.role`. More info at [https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html)

By default, all nodes are master eligible.

---

<div class="post-metadata">

**Author:** ![rgelb](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rgelb](https://discuss.elastic.co/u/rgelb)\
**Post date:** [April 30, 2020, 7:14pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/7 "2020-04-30T19:14:57Z")

</div>

So all three nodes report that they are master in elasticsearch.yml

**node.master: true**  
**node.data: true**

However, when I run **GET /\_cat/nodes** , I get this:

10.147.36.11 48 99 1 6.64 6.74 6.35 mdi - es-oc2-q01  
10.147.36.13 60 99 1 4.59 4.60 4.15 mdi \* es-oc2-q03  
10.147.36.12 54 99 3 7.29 8.33 7.84 mdi - es-oc2-q02.rediv.int

I assumed that the presence of an asterisk \* indicated that it's the master. Is that not the case?  
Or does it indicate that all nodes are master-eligible and have chosen es-oc2-q03 node to be master via the quorum?

Does it change anything with regards to the running the commands you outlined? Meaning, the order of the nodes on which I run them?

---

<div class="post-metadata">

**Author:** ![Luca\_Belluccini](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luca_belluccini/32/33239_2.png) [@Luca\_Belluccini](https://discuss.elastic.co/u/Luca_Belluccini)\
**Post date:** [April 30, 2020, 7:20pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/8 "2020-04-30T19:20:39Z")

</div>

Yes you have 3 master eligible nodes and one of them is master elected at the moment (the one with `*`).

The best 2 ways to restart the cluster are the ones linked in the documentation.

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [April 30, 2020, 7:48pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/9 "2020-04-30T19:48:14Z")

</div>

> [@rgelb](#):
>
> md

m=master

all nodes are master nodes. but q03 is taking lead. hence if you shutdown that automatically another will take lead. and that will have \*.

process is completely random.

I had three node cluster for long time and I did upgrade/update by shutting down everything and starting all.  
order is does not matter here because you shutting down all services.

now I have larger cluster and I now do rolling upgrade/update it takes little longer that is it.  
In this process as well no order matter.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 28, 2020, 7:48pm UTC](https://discuss.elastic.co/t/how-exactly-do-i-shutdown-then-restart-the-cluster/230622/10 "2020-05-28T19:48:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
