elasticsearch 重启节点

由于修改配置等原因,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"
    }
}


重复上面的步骤,全部重启所有节点

猜你喜欢

转载自leichenlei.iteye.com/blog/2384967