Pause a node of the cluster

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

Welcome to our community! :smiley:

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

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.

Welcome to our community! :smiley:

Thank you! :slight_smile:

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

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 be the answer?

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

Does it mean that Put shutdown API | Elasticsearch Guide [7.17] | Elastic would not work?

Any other way to graceful stop a node?

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

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

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