Elasticsearch 1.5.0 - 无法连接到请求节点

时间:2015-04-15 13:44:00

标签: java elasticsearch

我在windows机器上运行了elasticsearch(在我的网络上运行10.0.0.51)。我已经将应用程序部署到linux虚拟机(10.0.0.10)。当我的应用程序启动时,它会尝试连接到Elasticsearch并使用Java API创建节点:

node = nodeBuilder().client(true).clusterName(CLUSTER_NAME).node();
client = node.client();

然而,在Elasticsearch控制台中,我收到错误:

[2015-04-15 14:28:10,559][WARN ][discovery.zen.ping.multicast] [Matt Murdock] failed to connect to requesting node [Gatecrasher][dFF2VpWTQvCrilRKyVSC5Q][localhost.localdomain][inet[/10.0.0.10:9300]]{data=false, client=true}
org.elasticsearch.transport.ConnectTransportException: [Gatecrasher][inet[/10.0.0.10:9300]] connect_timeout[30s]
        at org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:797)
        at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:731)
        at org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:704)
        at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:216)
        at org.elasticsearch.discovery.zen.ping.multicast.MulticastZenPing$Receiver$1.run(MulticastZenPing.java:542)
        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 timed out: no further information: /10.0.0.10:9300
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716)
        at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:152)
        at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processSelectedKeys(NioClientBoss.java:105)
        at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:79)
        at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
        at org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:42)
        at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        ... 3 more

我可以在同一台计算机上运行这两个应用时连接到Elasticsearch。

更新

我刚刚将弹性搜索加载到与我的应用程序相同的VM上,但我无法连接。我只能在运行我的应用程序时进行连接,并在同一台Windows机器上进行弹性搜索。

1 个答案:

答案 0 :(得分:0)

这是我的Linux机器的网络问题。我做了各种各样的事情,包括转动防火墙,它开始工作。我认为防火墙阻止了访问。