4

ELK-学习笔记–如何优雅地下掉一台es节点 |坐而言不如起而行! 二丫讲梵

 3 years ago
source link: http://www.eryajf.net/5136.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
ELK-学习笔记–如何优雅地下掉一台es节点 |坐而言不如起而行! 二丫讲梵
> 日志管理 > ELK > <二十>ELK-学习笔记–如何优雅地下掉一台es节点
本文预计阅读时间 2 分钟

有时候可能某个节点需要某些维护,需要从集群中踢出,那么如何才能妥善将某个节点踢出呢?

  • 第一步:下线节点
    1. PUT _cluster/settings
    2. {
    3. "transient" : {
    4. "cluster.routing.allocation.exclude._name" : "elk-node2"
    5. }
    6. }

    表示第二个节点将要下线,操作之后就能够看到节点2上的分片都会往其他节点转移了。等转移完毕之后,就能下线了。

71cfeb93ly1gf8jakrb2ej20m80xcjvi.jpg

  • 如果只是重启节点,然后还要加入集群,可以转移完毕,重启,然后执行如下命令
    1. PUT _cluster/settings
    2. {
    3. "transient" : {
    4. "cluster.routing.allocation.exclude._name" : ""
    5. }
    6. }

    _name设为空,就好了。当然这个地方也可以替换成ip,host都可以。

当然如果新增或者调整配置,需要重启,可以在第一步进行之后,直接快速重启,而不必等到所有分片移走,如果数据量大的话,这将是个漫长的过程。


weinxin

二丫讲梵 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明<二十>ELK-学习笔记–如何优雅地下掉一台es节点

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK