Elasticsearch zen 发现 - 连接被拒绝:/127.0.0.1:9302

Elasticsearch zen discovery - Connection refused: /127.0.0.1:9302

在 Elasticsearch 中非常新,第一次尝试 Zen 发现插件。

我目前使用的是 5.0.0-alpha5 版本。这是我当前的设置:

cluster:
   name: Elastic-POC
node:
   name: ${HOSTNAME}-data
   master: false
   data: true
cloud:
    aws:
        access_key: xxxxxx
        secret_key: xxxxxx
        region: us-west-2
        ec2:
           protocol: http
           access_key: xxxxxx
           secret_key: xxxxxx
discovery:
    type: ec2
    zen.minimum_master_nodes: 1
    ec2.any_group: true
    ec2.groups: sg-xxxxxx
network:
    host: _ec2:privateIp_

以上设置来自"data"节点,无法加入"master"节点。我已经为发现插件启用了 "TRACE",这是我从日志中得到的:

[2016-07-12 00:30:39,377][INFO ][env                      ] [ip-172-29-1-44-data] heap size [15.8gb], compressed ordinary object pointers [true]
[2016-07-12 00:30:40,563][DEBUG][discovery.zen.elect      ] [ip-172-29-1-44-data] using minimum_master_nodes [1]
[2016-07-12 00:30:40,913][DEBUG][discovery.ec2            ] [ip-172-29-1-44-data] using host_type [PRIVATE_IP], tags [{}], groups [[sg-xxxxxx]] with any_group [true], availability_zones [[]]
[2016-07-12 00:30:40,914][DEBUG][discovery.zen.ping.unicast] [ip-172-29-1-44-data] using initial hosts [127.0.0.1, [::1]], with concurrent_connects [10]
[2016-07-12 00:30:40,922][DEBUG][discovery.zen            ] [ip-172-29-1-44-data] using ping_timeout [3s], join.timeout [1m], master_election.ignore_non_master [false]
[2016-07-12 00:30:40,925][DEBUG][discovery.zen.fd         ] [ip-172-29-1-44-data] [master] uses ping_interval [1s], ping_timeout [30s], ping_retries [3]
[2016-07-12 00:30:40,938][DEBUG][discovery.zen.fd         ] [ip-172-29-1-44-data] [node  ] uses ping_interval [1s], ping_timeout [30s], ping_retries [3]
[2016-07-12 00:30:41,250][DEBUG][discovery.ec2            ] [ip-172-29-1-44-data] using host_type [PRIVATE_IP], tags [{}], groups [[sg-xxxxxx]] with any_group [true], availability_zones [[]]
[2016-07-12 00:30:41,250][DEBUG][discovery.ec2            ] [ip-172-29-1-44-data] using host_type [PRIVATE_IP], tags [{}], groups [[sg-xxxxxx]] with any_group [true], availability_zones [[]]
[2016-07-12 00:30:41,252][INFO ][node                     ] [ip-172-29-1-44-data] initialized
[2016-07-12 00:30:41,252][INFO ][node                     ] [ip-172-29-1-44-data] starting ...
[2016-07-12 00:30:41,546][INFO ][transport                ] [ip-172-29-1-44-data] publish_address {172.29.1.44:9300}, bound_addresses {172.29.1.44:9300}
[2016-07-12 00:30:41,561][TRACE][discovery.zen            ] [ip-172-29-1-44-data] starting an election context, will accumulate joins
[2016-07-12 00:30:41,562][TRACE][discovery.zen            ] [ip-172-29-1-44-data] starting to ping
[2016-07-12 00:30:42,477][TRACE][discovery.ec2            ] [ip-172-29-1-44-data] building dynamic unicast discovery nodes...
[2016-07-12 00:30:42,477][DEBUG][discovery.ec2            ] [ip-172-29-1-44-data] using dynamic discovery nodes []
[2016-07-12 00:30:42,480][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_1#}{127.0.0.1}{127.0.0.1:9300}
[2016-07-12 00:30:42,480][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_2#}{127.0.0.1}{127.0.0.1:9301}
[2016-07-12 00:30:42,482][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_4#}{127.0.0.1}{127.0.0.1:9303}
[2016-07-12 00:30:42,482][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_5#}{127.0.0.1}{127.0.0.1:9304}
[2016-07-12 00:30:42,482][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_3#}{127.0.0.1}{127.0.0.1:9302}
[2016-07-12 00:30:42,483][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_6#}{::1}{[::1]:9300}
[2016-07-12 00:30:42,485][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_7#}{::1}{[::1]:9301}
[2016-07-12 00:30:42,485][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_8#}{::1}{[::1]:9302}
[2016-07-12 00:30:42,487][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_9#}{::1}{[::1]:9303}
[2016-07-12 00:30:42,487][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] connecting (light) to {#zen_unicast_10#}{::1}{[::1]:9304}
[2016-07-12 00:30:42,508][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] failed to connect to {#zen_unicast_3#}{127.0.0.1}{127.0.0.1:9302}
ConnectTransportException[[][127.0.0.1:9302] connect_timeout[30s]]; nested: ConnectException[Connection refused: /127.0.0.1:9302];
at org.elasticsearch.transport.netty.NettyTransport.connectToChannelsLight(NettyTransport.java:1008)
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:972)
at org.elasticsearch.transport.netty.NettyTransport.connectToNodeLight(NettyTransport.java:944)
at org.elasticsearch.transport.TransportService.connectToNodeLightAndHandshake(TransportService.java:325)
at org.elasticsearch.transport.TransportService.connectToNodeLightAndHandshake(TransportService.java:301)
at org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing.run(UnicastZenPing.java:398)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:392)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused: /127.0.0.1:9302
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.jboss.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
at org.jboss.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
at org.jboss.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.jboss.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker.run(DeadLockProofWorker.java:42)
... 3 more
[2016-07-12 00:30:42,510][TRACE][discovery.zen.ping.unicast] [ip-172-29-1-44-data] [1] failed to connect to {#zen_unicast_7#}{::1}{[::1]:9301}
ConnectTransportException[[][[::1]:9301] connect_timeout[30s]]; nested: ConnectException[Connection refused: /0:0:0:0:0:0:0:1:9301];
at org.elasticsearch.transport.netty.NettyTransport.connectToChannelsLight(NettyTransport.java:1008)
at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:972)
at org.elasticsearch.transport.netty.NettyTransport.connectToNodeLight(NettyTransport.java:944)
at org.elasticsearch.transport.TransportService.connectToNodeLightAndHandshake(TransportService.java:325)
at org.elasticsearch.transport.TransportService.connectToNodeLightAndHandshake(TransportService.java:301)
at org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing.run(UnicastZenPing.java:398)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:392)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.ConnectException: Connection refused: /0:0:0:0:0:0:0:1:9301
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.jboss.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
at org.jboss.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
at org.jboss.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
at org.jboss.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
at org.jboss.netty.util.internal.DeadLockProofWorker.run(DeadLockProofWorker.java:42)

我想通了。我的所有 ES 节点都无法调用 AWS API,因为到 www 的所有流量都被阻止了。结果,它在发现期间获得了默认主机地址。启用 www 流量(NAT 网关)后,它能够找到预期的 ES 主机。