E.S. 清退节点和再加回策略

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiangcheng001/article/details/70666275

1. 有时候需要将某个节点上的es数据清理出来,需要相关命令。

网址:https://www.elastic.co/guide/en/elasticsearch/reference/current/allocation-filtering.html

_ip/_host/_name都可以。


PUT _cluster/settings
{
  "transient" : {
    "cluster.routing.allocation.exclude._ip" : "10.0.0.1"
  }
}


2. 再加回节点。

PUT _cluster/settings
{
  "transient" : {
    "cluster.routing.allocation.exclude._ip" : ""
  }
}


也是神奇。


如果要shutdown节点,需要检查该节点上是否还有相应的shard。

curl -XGET 'http://ES_SERVER:9200/_nodes/NODE_NAME/stats/indices?pretty‌​'


猜你喜欢

转载自blog.csdn.net/xiangcheng001/article/details/70666275