Shutting down ElasticSearch

Even though we expect our cluster (or node) to run flawlessly for a lifetime, we may end up needing to restart it or shut it down properly (for example, for maintenance). There are three ways in which we can shut down ElasticSearch:

  • If your node is attached to the console (run with the –f option), just press Ctrl + C
  • The second option is to kill the server process by sending the TERM signal (see the kill command on the Linux boxes and program manager on Windows)
  • The third method is to use a REST API

We will focus on the last method now. It allows us to shut down the whole cluster by executing the following command:

curl -XPOST http://localhost:9200/_cluster/nodes/_shutdown

To shut down just a single node, execute the following ...

Get ElasticSearch Server now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.