【问题标题】:how do I get elasticsearch 5.6.3 cross cluster search working?如何让 elasticsearch 5.6.3 跨集群搜索工作?
【发布时间】:2025-12-17 19:55:02
【问题描述】:

我在使用 elasticsearch/kibana 5.6.3 时卡住了。我需要启用跨集群搜索。我能够让它在 6.8.6 版本中工作,但后来发现我现在被旧版本卡住了(因为我们必须升级数十台使用旧版本 fluentd 发送数据的服务器)。文档说要从控制台启用集群设置:

PUT _cluster/settings
{
  "persistent": {
    "cluster": {
      "remote": {
        "cluster-two": {
          "seeds": ["localhost:9301"]
        } 
      }
    }
  }
}

这会产生此错误消息:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "persistent setting [cluster.remote.cluster-two.seeds.0], not dynamically updateable"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "persistent setting [cluster.remote.cluster-two.seeds.0], not dynamically updateable"
  },
  "status": 400
}

我的弹性搜索配置文件:

cluster.name: cluster
node.name: node-1
http.port: 9200
transport.tcp.port: 9300

远程集群:

cluster.name: remote-cluster
node.name: node-1
http.port: 9201
transport.tcp.port: 9301

我假设我的错误意味着我需要直接在配置文件中更新此属性。我在 elasticsearch.yml 中尝试了一些选项,但没有运气。知道我需要进行哪些更新才能使跨集群搜索正常工作吗?

不工作:

cluster.remote.cluster_two.seeds: ["127.0.0.1:9301"] 
cluster.remote.cluster_two.seeds: 127.0.0.1:9301 
cluster:
   remote:
       cluster_two: 
           seeds: 127.0.0.1:9301

【问题讨论】:

  • 运行GET /_remote/info会得到什么?

标签: elasticsearch


【解决方案1】:

bleh ...我想我找到了here,但需要测试它是否有效。他们对 yaml 配置有不同的名称:

  • 5.6:search.remote.cluster_two.seeds
  • 6.8:cluster.remote.cluster_two.seeds

至少服务器现在启动了。我也可以在控制台中设置它而不会出错:

PUT _cluster/settings
{
  "persistent": {
    "search": {
      "remote": {
        "cluster_two": {
          "seeds": ["localhost:9301"]
        } 
      }
    }
  }
}

【讨论】: