首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ElasticSearch:如何关闭所有分片的重新分配?

ElasticSearch:如何关闭所有分片的重新分配?
EN

Stack Overflow用户
提问于 2015-04-02 16:54:36
回答 2查看 10.7K关注 0票数 6

我为elasticsearch开发了一个搜索插件,但在升级这个插件时,我需要一个接一个地关闭节点,每次我都要等待很长时间的重新分配过程。在文件中,它说重新分配过程可以通过以下方式停止:

代码语言:javascript
复制
curl -XPUT localhost:9200/_cluster/settings -d '{
    "transient" : {
           "cluster.routing.allocation.enable" : "none"
     }
}'

当我运行这个命令时,我得到了以下错误:

代码语言:javascript
复制
ElasticsearchIllegalArgumentException[Can't update non dynamic settings[[index.transient.cluster.routing.allocation.enable]] for open indices[..]

我能做什么?

顺便说一句:对不起,我的英语很差……

EN

回答 2

Stack Overflow用户

发布于 2015-04-03 21:00:51

就差那么一点!

尝试:

代码语言:javascript
复制
curl -XPUT 'http://localhost:9200/_cluster/settings' -d '{
"transient" : {
    "cluster.routing.allocation.disable_allocation": "true"
}}'
票数 4
EN

Stack Overflow用户

发布于 2019-05-18 03:48:13

OP可能使用较旧的Elasticsearch版本,不支持动态更新"cluster.routing.allocation.enable“和/或"cluster.routing.rebalance.enable”。

然而,在较新的Elasticsearch版本中,这两个设置应该是dynamictransient,而不是staticpersistent

以下是Elasticsearch当前文档中有关分片分配设置的更多详细信息。

https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html

用户可以在Kibana开发工具控制台中应用/撤销这些设置,如下所示

代码语言:javascript
复制
PUT _cluster/settings
{
  "transient" : {
    "cluster.routing.allocation.enable": "none",
    "cluster.routing.rebalance.enable" : "none"
  }
}

# After bouncing ES cluster
PUT _cluster/settings
{
  "transient" : {
    "cluster.routing.allocation.enable": "all",
    "cluster.routing.rebalance.enable" : "all"
  }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29408834

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档