我在2个不同的kubernetes VMS上有2个弹性集群,我尝试使用交叉集群进行连接。但是它不起作用,我在下面添加了详细信息,有人可以帮助我,告诉我我做错了什么或错过了什么吗?我尝试从一个弹性连接到另一个,如下所示:
GET _cluster/设置
{
"persistent" : {
"cluster" : {
"remote" : {
"cluster_three" : {
"mode" : "proxy",
"proxy_address" : "122.22.111.222:30005"
},
"cluster_two" : {
"mode" : "sniff",
"skip_unavailable" : "false",
"transport" : {
"compress" : "true"
},
"seeds" : [
"122.22.222.182:30005"
]
},
"cluster_one" : {
"seeds" : [
"127.0.0.1:9200"
],
"transport" : {
"ping_schedule" : "30s"
}
}
}
}
},
"transient" : { }
}
}我尝试在集群2上搜索,得到以下错误:
{"statusCode":502,"error":"Bad Gateway","message":"Client request timeout"}但是当我在elastic to cluste_two上做curl时,我得到了这个: curl 122.22.222.182:30005
{
"name" : "elasticsearch-client-7dcc49ddsdsd4-ljwasdpl",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "bOkaIrcFTgetsadaaY114N4a1EQ",
"version" : {
"number" : "7.10.2",
"build_flavor" : "oss",
"build_type" : "docker",
"build_hash" : "747e1cc71def077253878a59143c1f785asdasafa92b9",
"build_date" : "2021-01-13T00:42:12.435326Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"这是我在kubernetes上为cluste_two配置的svc:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
elasticsearch-client NodePort 10.111.11.28 <none> 9200:30005/TCP 27m
elasticsearch-discovery ClusterIP 10.111.11.11 <none> 9300/TCP 27m发布于 2021-02-10 12:26:21
Elasticsearch发现在端口9300而不是9200上工作,当您运行curl时,它将作为客户端请求通过端口30005。
请检查9300是否已打开以连接跨群集。当您的elasticsearch-discovery服务作为clusterIP运行时,您可能需要根据需要使用NodePort of LoadBalancer更改它的类型以暴露出K8s。
例如
# From cluster 1, we’ll define how the cluster-2 can be accessed
PUT /_cluster/settings
{
"persistent" : {
"cluster" : {
"remote" : {
"us-cluster" : {
"seeds" : [
"127.0.0.1:9300"
]
}
}
}
}
}https://stackoverflow.com/questions/66122015
复制相似问题