是时候用 ES 拯救发际线啦

closed index 如何漂移

Elasticsearch | 作者 Zhayhp | 发布于2020年10月27日 | 阅读数:901

现在有个 ES 集群, 有20台左右的物理机. 现在要将其中的3台物理机下线.但是其中有许多 closed indices. 如何只让要下线的3台物理机里的 indices(包括 closed indices) 漂移到其他机器上.  
已邀请:

keyso

赞同来自:

PUT /_cluster/settings
{
  "transient": {
    "cluster.routing.allocation.exclude._ip": "192.168.0.1,192.168.0.2,192.168.0.3"
  }
}

liuxg - Elastic

赞同来自:

你可以参照 shard filtering 的技术,把每个 node 打上标签。然后进行操作。你可以参考文档: https://www.elastic.co/guide/e ... .html 也可以参阅这篇文章https://elasticstack.blog.csdn ... 90044

pony_maggie - 公众号:犀牛饲养员的技术笔记

赞同来自:

首先停止往要下掉的节点分配,
 使用cluster.routing.allocation.exclude._ip或者cluster.routing.allocation.exclude._name
 
然后通过监控api确认分片都自动迁移到其它节点后,停掉旧节点服务

要回复问题请先登录注册