为什么对 elasticsearch /_cluster/settings 端点的 put 调用不会尊重设置更新?

Why won't a put call to the elasticsearch /_cluster/settings endpoint respect an update of settings?

我正在 运行正在使用 Elasticsearch 2.3.3,我希望建立一个集群,以便我可以模拟生产就绪设置。这是在 docker 的两个 Azure VM 上设置的。

我正在查看 /_cluster/settings api,以便我自己更新设置。根据 elasticserch documentation,应该可以更新集群上的设置。

我在每台机器上 运行 命令:

docker run -d --name elastic -p 9200:9200 -p 9300:9300 elasticsearch --cluster.name=api-update-test

所以现在每台机器都将自己视为 1 台机器集群中的一个主节点和数据节点。然后我向其中一个发出了一个放置请求,告诉它在哪里可以找到 discovery.zen.ping.unicast.hosts,并使用以下命令(在 powershell 中)

更新 discovery.zen.minimum_master_nodes
curl 
    -Method PUT 
    -Body '{"persistent":
        {"discovery.zen.minimum_master_nodes":2,
        "discovery.zen.ping.unicast.hosts":["<machine-one-ip>:9300"]}
    }' 
    -ContentType application/json 
    -Uri http://<machine-two-ip>:9200/_cluster/settings

响应总是返回 200 响应,但会确认原始设置:{"acknowledged":true,"persistent":{},"transient":{}}

为什么 elasticsearch 不尊重这个请求并更新这些设置?需要注意的是,当我在文档中使用示例请求的精确内容时,也会发生这种情况。

我一直使用这种方法:

curl -XPUT "http://localhost:9200/_cluster/settings" -d'
{
  "persistent": {
    "discovery.zen.minimum_master_nodes": 2
  }
}'

而且,只有 discovery.zen.minimum_master_nodes 可以动态更新。另一个不是。