How to stop/shut down an elasticsearch node?

前端 未结 11 1852
忘掉有多难
忘掉有多难 2021-01-29 22:34

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 t

11条回答
  •  佛祖请我去吃肉
    2021-01-29 22:59

    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:

      • Linux
      • Windows

    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'
    

提交回复
热议问题