ElasticSearch:如何禁用所有分片的分片重新分配?

Jin*_*hen 5 elasticsearch

我开发了一个用于Elasticsearch的搜索插件,但是在升级该插件时,我需要逐个关闭节点,并且每次必须等待很长时间才能重新分配。在该文件中,它表示可以通过以下方式停止重新分配过程:

curl -XPUT localhost:9200/_cluster/settings -d '{
    "transient" : {
           "cluster.routing.allocation.enable" : "none"
     }
}'
Run Code Online (Sandbox Code Playgroud)

当我运行此命令时,出现以下错误:

ElasticsearchIllegalArgumentException[Can't update non dynamic settings[[index.transient.cluster.routing.allocation.enable]] for open indices[..]
Run Code Online (Sandbox Code Playgroud)

我能做什么?

顺便说一句:对不起,我英语不好...

Gle*_*ith 7

很近!

尝试:

curl -XPUT 'http://localhost:9200/_cluster/settings' -d '{
"transient" : {
    "cluster.routing.allocation.disable_allocation": "true"
}}'
Run Code Online (Sandbox Code Playgroud)