es 集群配置更新失败 - 超时

# DSL 控制台执行后,会返回 504 Timeout,但配置始终未被更新
# Shell 如下
curl -X PUT http://127.0.0.1:9200/_cluster/settings -d '{"transient":{"cluster.routing.allocation.total_shards_per_node":null}}'
{
  "error" : {
    "root_cause" : [
      {
        "type" : "process_cluster_event_timeout_exception",
        "reason" : "failed to process cluster event (cluster_update_settings) within 30s"
      }
    ],
    "type" : "process_cluster_event_timeout_exception",
    "reason" : "failed to process cluster event (cluster_update_settings) within 30s"
  },
  "status" : 503
}
阅读 7.2k
1 个回答

原因可能比较复杂:
比如 索引太多、分片太多、集群正在处理的任务较多、内部连接因为 xxx 原因都在等待导致阻塞等。

情况紧急的的话,可以通过临时指定较长的超时时间来操作。

master_timeout
(Optional, time units) Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s.
# 使用参数 master_timeout=5m,来延长获取链接的默认时长
curl -X PUT http://127.0.0.1:9200/_cluster/settings?master_timeout=5m -d '{"transient":{"cluster.routing.allocation.total_shards_per_node":null}}'

Ref: https://www.elastic.co/guide/...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进