弹性搜索:在关闭数据节点之前撤出所有数据? [英] Elasticsearch: evacuate all data before shutdown of a data node?

查看:129
本文介绍了弹性搜索:在关闭数据节点之前撤出所有数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法告诉一个节点删除所有的数据(在其他节点之间传播它),以便我可以关闭它,一旦它下来就不会处理重新平衡/重新复制?



如果我有每个分片的2个副本,并且我放弃一个节点,则某些分片现在只有一个实时副本,必须重新复制。如果可以,我宁愿不下降到一个实时拷贝。

解决方案

发布到ES邮件列表,我被告知正确的答案在于_cluster / settings api,具体来说是cluster.routing.allocation.exclude._ip选项。



从文档: http://www.elasticsearch.org/guide/en /elasticsearch/reference/current/modules-cluster.html

  curl -XPUT localhost:9200 / _cluster / settings -d'{
transient:{
cluster.routing.allocation.exclude._ip:10.0.0.1
}
}'

IP地址可以是逗号分隔的列表。要排除,只需从列表中删除IP(或将列表设置为以删除所有排除的IP)。



希望这可以帮助其他人寻找这个问题的答案。


Is there a way to tell a node to remove all of its data (spread it back out among the other nodes) so that I can shut it down and not deal with a rebalance/re-replicate once its down?

If I have 2 copies of each shard, and I drop one node, some of the shards now only have 1 live copy and it has to be re-replicated. I'd prefer to not drop down to 1 live copy for any period of time if I can.

解决方案

After posting to the ES mailing list, I was informed the proper answer lies in the _cluster/settings api, specifically the cluster.routing.allocation.exclude._ip option.

From the docs: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-cluster.html

curl -XPUT localhost:9200/_cluster/settings -d '{
  "transient" : {
    "cluster.routing.allocation.exclude._ip" : "10.0.0.1"
  }
}'

The IP address can be a comma separated list. To 'un-exclude', just remove the IP from the list (or set the list to "" to remove all excluded IPs).

Hopefully this helps others looking for the answer to this same question.

这篇关于弹性搜索:在关闭数据节点之前撤出所有数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆