# Pause a node of the cluster

**URL:** <https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964>\
**Category:** Elasticsearch\
**Created:** [April 27, 2023, 2:03pm UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964 "2023-04-27T14:03:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blacktek](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Blacktek](https://discuss.elastic.co/u/Blacktek)\
**Post date:** [April 27, 2023, 2:03pm UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/1 "2023-04-27T14:03:12Z")

</div>

Hello,  
we've a three nodes cluster, and every once in a while we need to restart services or nodes to perform updates.

We'd like to perform such activity in a graceful manner, waiting that current in-flight requests complete, and at the same time by not accepting new requests.

I've googled a lot, I've only found a way to do that using a Cluster interface using a function to stop routing. But we do not use any cluster interface and I'm interested in knowing the curl command to perform such action.

Can you help?

What happens internally when I run systemctl stop elasticsearch? does it wait that current requests complete? I've found several 5xx errors in the application during es restarts, I'm not sure that is a "gentle" stop

Thank you

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 30, 2023, 11:09pm UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/2 "2023-04-30T23:09:25Z")

</div>

Welcome to our community! 😃

> [@Blacktek](#):
>
> I've googled a lot, I've only found a way to do that using a Cluster interface using a function to stop routing. But we do not use any cluster interface and I'm interested in knowing the curl command to perform such action.

It's not clear what you mean here, and sharing what you have found and where will help us guide you.

> [@Blacktek](#):
>
> What happens internally when I run systemctl stop elasticsearch?

It tells Elasticsearch to stop and it'll start to shutdown with no regards to what is happening on that node.

That's because in a distributed system you can never guarantee that the node you are talking to will be available, so your code should be able to handle this and retry if needed.

---

<div class="post-metadata">

**Author:** ![Blacktek](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Blacktek](https://discuss.elastic.co/u/Blacktek)\
**Post date:** [May 1, 2023, 7:12am UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/3 "2023-05-01T07:12:30Z")

</div>

> Welcome to our community! 😃

Thank you! 🙂

> It's not clear what you mean here, and sharing what you have found and where will help us guide you.

I've found this: [Stop routing requests | Elasticsearch Service Documentation | Elastic](https://www.elastic.co/guide/en/cloud/current/ec-maintenance-mode-deployments.html)

I would do the same using curl. Basically I'm looking at a clean way to make maintenance on a node, waiting that current pending requests complete before stopping it (in the meantime no new requests should be accepted).

Any idea on how to achieve this goal?  
Could [Put shutdown API | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/put-shutdown.html) be the answer?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 1, 2023, 10:51am UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/4 "2023-05-01T10:51:45Z")

</div>

That's for our Elasticsearch Service, which has a layer of abstraction on it to allow that. Native Elasticsearch cannot do this.

---

<div class="post-metadata">

**Author:** ![Blacktek](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Blacktek](https://discuss.elastic.co/u/Blacktek)\
**Post date:** [May 1, 2023, 11:04am UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/5 "2023-05-01T11:04:37Z")

</div>

Does it mean that [Put shutdown API | Elasticsearch Guide [7.17] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.17/put-shutdown.html) would not work?

Any other way to graceful stop a node?

---

<div class="post-metadata">

**Author:** ![Blacktek](https://avatars.discourse-cdn.com/v4/letter/b/977dab/32.png) [@Blacktek](https://discuss.elastic.co/u/Blacktek)\
**Post date:** [May 16, 2023, 7:00am UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/6 "2023-05-16T07:00:56Z")

</div>

Hello,  
no plan to introduce a graceful stop of the service? Basically a service stop command that would stop accepting new requests while waiting some seconds to complete those already started before the stop? Like php-fpm

Thank you

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 16, 2023, 9:34am UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/7 "2023-05-16T09:34:15Z")

</div>

You'd need to put a feature request in for that.

---

<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:** [June 13, 2023, 9:34am UTC](https://discuss.elastic.co/t/pause-a-node-of-the-cluster/330964/8 "2023-06-13T09:34:29Z")

</div>

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