如何在运行时没有停机时间从弹性搜索集群中删除节点 [英] How to remove node from elasticsearch cluster on runtime without down time

查看:128
本文介绍了如何在运行时没有停机时间从弹性搜索集群中删除节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我在集群中有5个节点,而在运行时我不得不删除2个节点。那么在不影响指标的情况下怎么做呢?



我连续的数据流已经接近10Gbb,连续索引。



重新平衡会在这方面做任何帮助吗?感谢提前

解决方案

您可以通过告知集群将其排除在分配之外来停用节点。 (从文档此处

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

这将导致Elasticsearch将该节点上的分片分配给剩余的节点,而不将集群的状态更改为黄色或红色(即使您有复制0)。



一旦所有的分片都被重新分配,你可以关闭节点,并做任何你需要做的。一旦你完成,包括分配的节点和弹性搜索将重新平衡碎片。


Suppose I had 5 nodes in cluster and I had to remove 2 node on run-time. So how it can be done without affecting the indices?

I had continuous stream of data coming at nearly 10 Gbphour which is getting indexed continuously.

Is rebalancing will do any help in this? Thanks in advance

解决方案

You can decommission a node by telling the cluster to exclude it from allocation. (From the documentation here)

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

This will cause Elasticsearch to allocate the shards on that node to the remaining nodes, without the state of the cluster changing to yellow or red (even if you have replication 0).

Once all the shards have been reallocated you can shutdown the node and do whatever you need to do there. Once you're done, include the node for allocation and Elasticsearch will rebalance the shards again.

这篇关于如何在运行时没有停机时间从弹性搜索集群中删除节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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