# Is it possible to "disable" the node without shutting it down completely?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351>\
**Category:** Elasticsearch\
**Created:** [August 28, 2018, 1:25pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351 "2018-08-28T13:25:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Victor\_S](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Victor\_S](https://discuss.elastic.co/u/Victor_S)\
**Post date:** [August 28, 2018, 1:25pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351/1 "2018-08-28T13:25:07Z")

</div>

(and to re-enable it again later without restarting the process?)  
so the master node will promote replica shards from an another node to primary ones, node\_left timer will be started, and so on?

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [August 28, 2018, 2:10pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351/2 "2018-08-28T14:10:24Z")

</div>

> [@Victor\_S](#):
>
> so the master node will promote replica shards from an another node to primary ones

This happens automatically whenever a node falls out of the cluster, then replica shards on the other nodes will get promoted to primary shards to replace the primaries on the node that fell out. When the node returns to the cluster it will only contain replica shards.

What I don't understand is why you want to "move" the primary shards away from one specific node. This is kind of pointless since the replica shards also have to be updated, whenever a primary is, and usually will get as many search requests to process as the primary. And even if you "move" all primary shards to other nodes they will trickle back when other nodes fall out of the cluster, which will happen, or when a new index is created in the cluster.

---

<div class="post-metadata">

**Author:** ![Victor\_S](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Victor\_S](https://discuss.elastic.co/u/Victor_S)\
**Post date:** [August 28, 2018, 2:41pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351/3 "2018-08-28T14:41:53Z")

</div>

Actually, I'm planning a rolling upgrade, but I need a way to gracefully kick off the node out of the cluster first, before sending it SIGTERM that may take longer to process if the node is still in the cluster (e.g. because of pending index requests) and may cause killing the process by the underlying infrastructure after a timeout, which is not desirable.  
There's software under the hood allowing to implement two-phase shutdown procedure, and the first phase is supposed to be asynchronous, i.e. send a "graceful shutdown" request, wait until all background tasks on that node are finished (e.g. by periodically polling the node), and only then send SIGTERM (which should be handled much faster this time).

---

<div class="post-metadata">

**Author:** ![Bernt\_Rostad](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@Bernt\_Rostad](https://discuss.elastic.co/u/Bernt_Rostad)\
**Post date:** [August 28, 2018, 2:50pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351/4 "2018-08-28T14:50:31Z")

</div>

I've implemented a controller to do something similar; it sends a SIGTERM (kill -15 ) to the running Elasticsearch process and waits for it to shut down gracefully. It uses SIGKILL (kill -9 ) only for emergency stops or if the SIGTERM fails to stop the process within a given time limit. The controller works equally well whether the node has just replica shards or primary shards.

---

<div class="post-metadata">

**Author:** ![Victor\_S](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Victor\_S](https://discuss.elastic.co/u/Victor_S)\
**Post date:** [August 28, 2018, 3:16pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351/5 "2018-08-28T15:16:46Z")

</div>

I have a similar thing, but I'd like to avoid killing the process whenever possible, so I need a way to ensure that SIGTERM will be always handled as fast as possible.

---

<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:** [September 25, 2018, 3:16pm UTC](https://discuss.elastic.co/t/is-it-possible-to-disable-the-node-without-shutting-it-down-completely/146351/6 "2018-09-25T15:16:55Z")

</div>

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