Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: Elasticsearch Docker containers not connecting to each other

Hi,
I have created two elastic search docker containers in two OpenStack VMs as follows -

docker pull docker.elastic.co/elasticsearch/elasticsearch:5.5.0

docker run --name elasticsearch -p 9200:9200 -p 9300-9400:9300-9400 docker.elastic.co/elasticsearch/elasticsearch:5.5.0

My elasticsearch.yml
at - "10.247.61.131" is as follows -

cluster.name: "logging"
network.host: 0.0.0.0
node.name: "es_0"
network.bind_host: 0.0.0.0
network.publish_host: "10.247.61.131"
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.unicast.hosts:

  • 10.247.61.131
  • 10.247.61.132

an at "10.247.61.32", as follows -

cluster.name: "logging"
network.host: 0.0.0.0
node.name: "es_1"
network.bind_host: 0.0.0.0
network.publish_host: "10.247.61.32"
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.unicast.hosts:

  • 10.247.61.131
  • 10.247.61.132

When I am starting them, I am facing this problem -

org.elasticsearch.transport.ConnectTransportException: [es_1][10.247.61.32:9300] connect_timeout[30s]
at org.elasticsearch.transport.netty4.Netty4Transport.connectToChannels(Netty4Transport.java:361) ~[?:?]
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:548) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.transport.TcpTransport.connectToNode(TcpTransport.java:472) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:332) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:319) ~[elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.discovery.zen.ZenDiscovery.joinElectedMaster(ZenDiscovery.java:459) [elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.discovery.zen.ZenDiscovery.innerJoinCluster(ZenDiscovery.java:411) [elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.discovery.zen.ZenDiscovery.access$4100(ZenDiscovery.java:83) [elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.discovery.zen.ZenDiscovery$JoinThreadControl$1.run(ZenDiscovery.java:1188) [elasticsearch-5.5.0.jar:5.5.0]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-5.5.0.jar:5.5.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: 10.247.61.32/10.247.61.32:9300
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:267) ~[?:?]
at io.netty.util.concurrent.PromiseTask$RunnableAdapter.call(PromiseTask.java:38) ~[?:?]
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:120) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403) ~[?:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462) ~[?:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) ~[?:?]

Both VMs are running on same intranet.

One more thing, when I am making the independent clusters & trying to connect from 3rd VM using Elasticsearch Java Clients, it is working fine as follows -

TransportClient client = new PreBuiltXPackTransportClient(Settings.builder()
.put("cluster.name", "onap-logging")
.put("xpack.security.user", "elastic:changeme")
.build())
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("10.247.61.132"), 9300));

Please help me with where I am wrong?
Search a lot in Google, but could not find much help

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.