Elasticsearch分布式安装错误之:handshack failed

记录一个分布式安装elasticsearch时,遇到的一个大坑:

错误配置:

master:

cluster.name: es-cluster
node.name: abe-ubuntu

http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.189.150"]

slave01:

cluster.name: es-cluster
node.name: abe01


http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.189.150"]

slave02:

cluster.name: es-cluster
node.name: abe02


http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.189.150"]

报错信息:

[2017-09-23T00:05:53,647][WARN ][o.e.d.z.ZenDiscovery     ] [abe02] failed to connect to master [{abe01}{hh797yorQAu6i_-3wh9r7w}{_7_HDenIQlu-ZQDhLazvXQ}{127.0.0.1}{127.0.0.1:9300}], retrying...
org.elasticsearch.transport.ConnectTransportException: [abe01][127.0.0.1:9300] handshake failed. unexpected remote node {abe02}{Mcmb0lWYQryu6upJXBc2sw}{ToJgZghMQkyE6REwIVbW2A}{127.0.0.1}{127.0.0.1:9300}
        at org.elasticsearch.transport.TransportService.lambda$connectToNode$3(TransportService.java:336) ~[elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.transport.TcpTransport.connectToNode(TcpTransport.java:465) ~[elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:332) ~[elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:319) ~[elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.discovery.zen.ZenDiscovery.joinElectedMaster(ZenDiscovery.java:458) [elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.discovery.zen.ZenDiscovery.innerJoinCluster(ZenDiscovery.java:410) [elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.discovery.zen.ZenDiscovery.access$4100(ZenDiscovery.java:82) [elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.discovery.zen.ZenDiscovery$JoinThreadControl$1.run(ZenDiscovery.java:1188) [elasticsearch-5.6.1.jar:5.6.1]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-5.6.1.jar:5.6.1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]

正确配置:

master:

cluster.name: es-cluster
node.name: abe-ubuntu

network.host: 192.168.189.150  # 必须要有,否则报handshake failed错误

http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.189.150"]

slave01:

cluster.name: es-cluster
node.name: abe01

network.host: 192.168.189.191

http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.189.150"]

slave02:

cluster.name: es-cluster
node.name: abe02

network.host: 192.168.189.192

http.cors.enabled: true
http.cors.allow-origin: "*"

node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.189.150"]

效果图:
这里写图片描述

本站部分文章源于互联网,本着传播知识、有益学习和研究的目的进行的转载,为网友免费提供。如有著作权人或出版方提出异议,本站将立即删除。如果您对文章转载有任何疑问请告之我们,以便我们及时纠正。

PS:推荐一个微信公众号: askHarries 或者qq群:474807195,里面会分享一些资深架构师录制的视频录像:有Spring,MyBatis,Netty源码分析,高并发、高性能、分布式、微服务架构的原理,JVM性能优化这些成为架构师必备的知识体系。还能领取免费的学习资源,目前受益良多

转载请注明原文出处:Harries Blog™ » Elasticsearch分布式安装错误之:handshack failed

分享到:更多 ()

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址