官术网_书友最值得收藏!

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 command:

curl –XPOST http://localhost:9200/_cluster/nodes/BlrmMvBdSKiCeYGsiHijdg/_shutdown

In the previous command line, BlrmMvBdSKiCeYGsiHijdg is the identifier for a given node. The former may be read from ElasticSearch logs or from another API call:

curl -XGET http://localhost:9200/_cluster/nodes/
主站蜘蛛池模板: 五原县| 北碚区| 永康市| 易门县| 新巴尔虎右旗| 固安县| 松溪县| 玉林市| 全椒县| 武夷山市| 德庆县| 商河县| 高雄市| 高唐县| 吉安县| 连州市| 平原县| 青龙| 应城市| 衡水市| 新余市| 镇雄县| 三都| 绥宁县| 东阳市| 宜章县| 永清县| 西青区| 长岭县| 昌黎县| 平武县| 肇庆市| 寿光市| 富锦市| 柳河县| 宁蒗| 茌平县| 定边县| 齐齐哈尔市| 佛学| 镇江市|