elasticsearch 重启节点

来源:互联网 发布:网店代运营知乎 编辑:程序博客网 时间:2024/05/22 14:19

由于修改配置等原因,elasticsearch需要重启节点,如果操作不当会造成整个集群崩溃,主要是因为elasticsearch有再平衡策略,就是当一个节点停机,整个集群就开始执行再平衡策略,集群开始移动分片,elasticsearch的健康状态不再是绿色。

 

可以通过集群API  关闭再平衡策略,再进行节点重启:

 

1,put  http://localhost:9092/_cluster/settings   {        "transient" : {            "cluster.routing.allocation.enable" : "none"        }    }2,重启一个节点3,put  http://localhost:9092/_cluster/settings{    "transient" : {        "cluster.routing.allocation.enable" : "all"    }}重复上面的步骤,全部重启所有节点

 

原创粉丝点击