How to shutdown ES using API call

Hi, I am wondering if there is a way or an API using which I can shutdown my ES server?

Is this what you are looking for

I looked into this but it's somehow not working for me.
Do I need to follow some steps to enable this?

This API just prepares the node for the shutdown, it will not terminate the process in the server, you need to do this yourself using another tool or directly on the server.

There is no API that will terminate the process.

Actually, I am running Elasticsearch using docker and I want to stop the server in a clean way and not by pressing ctrl+c and docker stop.
So, Is there a way I can do that?

This is an infrastructure issue then, not an Elasticsearch one.

There is no API in Elasticsearch that would shutdown the node, the documentation linked is an API to prepare the node to be decomissioned, also the _shutdown API only works when you are running Elasticsearch using Elastic Cloud, ECE or ECK, which is not your case.

If you are using Docker compose you will just use docker compose down, if you are running the node directly from the cli, a CTRL+C is the way to stop.

Both cases will result on a graceful shutdown of the service.

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