I want to restart an elasticsearch node with a new configuration. What is the best way to gracefully shut down an node?
Is killing the process the best way of shutting the server down, or is there some magic URL I can use to shut the node down?
/usr/local/share/elasticsearch/bin/service/elasticsearch Usage: /usr/local/share/elasticsearch/bin/service/elasticsearch [ console | start | stop | restart | condrestart | status | install | remove | dump ] Commands: console Launch in the current console. start Start in the background as a daemon process.
While reading about Elasticsearch I understood that Nodes have Shards. And we can make configuration for Primary and Replica Shards. If one of node goes down it retrieve data from replica shards which is in another node.
Updated answer.
_shutdown
API has been removed in elasticsearch 2.x.
Some options:
In your terminal (dev mode basically), just type "Ctrl-C"
If you started it as a daemon (-d
) find the PID and kill the process: SIGTERM
will shut Elasticsearch down cleanly (kill -15 PID
)
If running as a service, run something like service elasticsearch stop
:
Previous answer. It's now deprecated from 1.6.
Yeah. See admin cluster nodes shutdown documentation
Basically:
# Shutdown local node $ curl -XPOST 'http://localhost:9200/_cluster/nodes/_local/_shutdown' # Shutdown all nodes in the cluster $ curl -XPOST 'http://localhost:9200/_shutdown'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With