# How to connect elasticsearch instance of docker VMs from two different machine?

**URL:** <https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782>\
**Category:** Elasticsearch\
**Created:** [September 15, 2014, 11:02am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782 "2014-09-15T11:02:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anand\_kumar](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Anand\_kumar](https://discuss.elastic.co/u/Anand_kumar)\
**Post date:** [September 15, 2014, 11:02am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/1 "2014-09-15T11:02:40Z")

</div>

Hi all,

```
 I'm trying to connect two ES instances using docker VM and both as 

```

master nodes, but the instances belong to two different hosts from the same  
network.

My docker commands are as below:

host1 : $ docker run -t -i --name="master-node-01" -p 9200:9200 -p  
9300:9300  
host2 : $ docker run -t -i --name="master-node-02" -p 9200:9200 -p  
9300:9300 (as the host were different, am using the same port for both)

And I used the configurations as follows:

host1 : discovery.zen.ping.unicast.hosts: ["host2"]  
host2 : discovery.zen.ping.unicast.hosts: ["host1"]

When i tried to start the host2 instance after starting the host1, I cant  
able connect the host2 with the host1

and tried some other configurations like

host1 : discovery.zen.ping.unicast.hosts: ["host2:9200"]  
host2 : discovery.zen.ping.unicast.hosts: ["host1:9200"]

host1 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]  
host2 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]

But I'm getting the following issues, Is it possible to connect the VMs of  
different host through ES

[2014-09-15 09:46:46,920][WARN][transport.netty]  
[ES\_MASTER\_NODE\_1] exception caught on transport layer [[id: 0x2f06682e]],  
closing connection  
java.net.NoRouteToHostException: No route to host  
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
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:318)  
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)  
at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:724)

Any suggestion would be helpful. Thanks in advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 15, 2014, 11:06am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/2 "2014-09-15T11:06:17Z")

</div>

Are they on the same network?  
Can you telnet to each of the hosts?

It looks like the two nodes don't have access to each other, hence the no  
route to host error.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 15 September 2014 21:02, Anand kumar [anandv1000@gmail.com](mailto:anandv1000@gmail.com) wrote:

> Hi all,
> 
> ```
> I'm trying to connect two ES instances using docker VM and both as
> 
> ```
> 
> master nodes, but the instances belong to two different hosts from the same  
> network.
> 
> My docker commands are as below:
> 
> host1 : $ docker run -t -i --name="master-node-01" -p 9200:9200 -p  
> 9300:9300  
> host2 : $ docker run -t -i --name="master-node-02" -p 9200:9200 -p  
> 9300:9300 (as the host were different, am using the same port for both)
> 
> And I used the configurations as follows:
> 
> host1 : discovery.zen.ping.unicast.hosts: ["host2"]  
> host2 : discovery.zen.ping.unicast.hosts: ["host1"]
> 
> When i tried to start the host2 instance after starting the host1, I cant  
> able connect the host2 with the host1
> 
> and tried some other configurations like
> 
> host1 : discovery.zen.ping.unicast.hosts: ["host2:9200"]  
> host2 : discovery.zen.ping.unicast.hosts: ["host1:9200"]
> 
> host1 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]  
> host2 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]
> 
> But I'm getting the following issues, Is it possible to connect the VMs of  
> different host through ES
> 
> [2014-09-15 09:46:46,920][WARN][transport.netty]  
> [ES\_MASTER\_NODE\_1] exception caught on transport layer [[id: 0x2f06682e]],  
> closing connection  
> java.net.NoRouteToHostException: No route to host  
> at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> at  
> org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
> 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:318)  
> 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)  
> at  
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:724)
> 
> Any suggestion would be helpful. Thanks in advance.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624ZKmBB\_U1yzNfsbyf-cozFiVmPteb1wSp40q8KwkF1ijA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624ZKmBB_U1yzNfsbyf-cozFiVmPteb1wSp40q8KwkF1ijA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anand\_kumar](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Anand\_kumar](https://discuss.elastic.co/u/Anand_kumar)\
**Post date:** [September 15, 2014, 11:34am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/3 "2014-09-15T11:34:04Z")

</div>

Hi Mark,

Thanks for your reply.

Yeah, both the hosts belonged to same network.  
I cant able to use telnet, instead I tried ssh.

On Monday, 15 September 2014 16:36:53 UTC+5:30, Mark Walkom wrote:

> Are they on the same network?  
> Can you telnet to each of the hosts?
> 
> It looks like the two nodes don't have access to each other, hence the no  
> route to host error.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 15 September 2014 21:02, Anand kumar \<[anand...@gmail.com](mailto:anand...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi all,
> > 
> > ```
> > I'm trying to connect two ES instances using docker VM and both as 
> > 
> > ```
> > 
> > master nodes, but the instances belong to two different hosts from the same  
> > network.
> > 
> > My docker commands are as below:
> > 
> > host1 : $ docker run -t -i --name="master-node-01" -p 9200:9200 -p  
> > 9300:9300  
> > host2 : $ docker run -t -i --name="master-node-02" -p 9200:9200 -p  
> > 9300:9300 (as the host were different, am using the same port for both)
> > 
> > And I used the configurations as follows:
> > 
> > host1 : discovery.zen.ping.unicast.hosts: ["host2"]  
> > host2 : discovery.zen.ping.unicast.hosts: ["host1"]
> > 
> > When i tried to start the host2 instance after starting the host1, I cant  
> > able connect the host2 with the host1
> > 
> > and tried some other configurations like
> > 
> > host1 : discovery.zen.ping.unicast.hosts: ["host2:9200"]  
> > host2 : discovery.zen.ping.unicast.hosts: ["host1:9200"]
> > 
> > host1 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]  
> > host2 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]
> > 
> > But I'm getting the following issues, Is it possible to connect the VMs  
> > of different host through ES
> > 
> > [2014-09-15 09:46:46,920][WARN][transport.netty]  
> > [ES\_MASTER\_NODE\_1] exception caught on transport layer [[id: 0x2f06682e]],  
> > closing connection  
> > java.net.NoRouteToHostException: No route to host  
> > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:708)  
> > at  
> > org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.connect(NioClientBoss.java:150)  
> > 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:318)  
> > 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)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
> > at  
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
> > at java.lang.Thread.run(Thread.java:724)
> > 
> > Any suggestion would be helpful. Thanks in advance.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 15, 2014, 11:37am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/4 "2014-09-15T11:37:54Z")

</div>

Your problem is a docker networking issue, not an ES one.  
I'm not familiar with docker so can't help much more sorry.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 15 September 2014 21:34, Anand kumar [anandv1000@gmail.com](mailto:anandv1000@gmail.com) wrote:

> Hi Mark,
> 
> Thanks for your reply.
> 
> Yeah, both the hosts belonged to same network.  
> I cant able to use telnet, instead I tried ssh.
> 
> On Monday, 15 September 2014 16:36:53 UTC+5:30, Mark Walkom wrote:
> 
> > Are they on the same network?  
> > Can you telnet to each of the hosts?
> > 
> > It looks like the two nodes don't have access to each other, hence the no  
> > route to host error.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 15 September 2014 21:02, Anand kumar [anand...@gmail.com](mailto:anand...@gmail.com) wrote:
> > 
> > > Hi all,
> > > 
> > > ```
> > > I'm trying to connect two ES instances using docker VM and both as
> > > 
> > > ```
> > > 
> > > master nodes, but the instances belong to two different hosts from the same  
> > > network.
> > > 
> > > My docker commands are as below:
> > > 
> > > host1 : $ docker run -t -i --name="master-node-01" -p 9200:9200 -p  
> > > 9300:9300  
> > > host2 : $ docker run -t -i --name="master-node-02" -p 9200:9200 -p  
> > > 9300:9300 (as the host were different, am using the same port for both)
> > > 
> > > And I used the configurations as follows:
> > > 
> > > host1 : discovery.zen.ping.unicast.hosts: ["host2"]  
> > > host2 : discovery.zen.ping.unicast.hosts: ["host1"]
> > > 
> > > When i tried to start the host2 instance after starting the host1, I  
> > > cant able connect the host2 with the host1
> > > 
> > > and tried some other configurations like
> > > 
> > > host1 : discovery.zen.ping.unicast.hosts: ["host2:9200"]  
> > > host2 : discovery.zen.ping.unicast.hosts: ["host1:9200"]
> > > 
> > > host1 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]  
> > > host2 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]
> > > 
> > > But I'm getting the following issues, Is it possible to connect the VMs  
> > > of different host through ES
> > > 
> > > [2014-09-15 09:46:46,920][WARN][transport.netty]  
> > > [ES\_MASTER\_NODE\_1] exception caught on transport layer [[id: 0x2f06682e]],  
> > > closing connection  
> > > java.net.NoRouteToHostException: No route to host  
> > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > at sun.nio.ch.SocketChannelImpl.finishConnect(  
> > > SocketChannelImpl.java:708)  
> > > at org.elasticsearch.common.netty.channel.socket.nio.  
> > > NioClientBoss.connect(NioClientBoss.java:150)  
> > > 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:318)  
> > > 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)  
> > > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > > ThreadPoolExecutor.java:1145)  
> > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > > ThreadPoolExecutor.java:615)  
> > > at java.lang.Thread.run(Thread.java:724)
> > > 
> > > Any suggestion would be helpful. Thanks in advance.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%  
> > > [40googlegroups.com](http://40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624aZ6VuedjJNkOt9DrTRd%2Bzih4tt1k-B6DVigu90CUsjfA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624aZ6VuedjJNkOt9DrTRd%2Bzih4tt1k-B6DVigu90CUsjfA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Anand\_kumar](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@Anand\_kumar](https://discuss.elastic.co/u/Anand_kumar)\
**Post date:** [September 15, 2014, 11:42am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/5 "2014-09-15T11:42:04Z")

</div>

Thank you Mark for your precious time.

On Monday, 15 September 2014 17:08:48 UTC+5:30, Mark Walkom wrote:

> Your problem is a docker networking issue, not an ES one.  
> I'm not familiar with docker so can't help much more sorry.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com) \<javascript:\>  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 15 September 2014 21:34, Anand kumar \<[anand...@gmail.com](mailto:anand...@gmail.com) \<javascript:\>\>  
> wrote:
> 
> > Hi Mark,
> > 
> > Thanks for your reply.
> > 
> > Yeah, both the hosts belonged to same network.  
> > I cant able to use telnet, instead I tried ssh.
> > 
> > On Monday, 15 September 2014 16:36:53 UTC+5:30, Mark Walkom wrote:
> > 
> > > Are they on the same network?  
> > > Can you telnet to each of the hosts?
> > > 
> > > It looks like the two nodes don't have access to each other, hence the  
> > > no route to host error.
> > > 
> > > Regards,  
> > > Mark Walkom
> > > 
> > > Infrastructure Engineer  
> > > Campaign Monitor  
> > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > 
> > > On 15 September 2014 21:02, Anand kumar [anand...@gmail.com](mailto:anand...@gmail.com) wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > ```
> > > > I'm trying to connect two ES instances using docker VM and both as 
> > > > 
> > > > ```
> > > > 
> > > > master nodes, but the instances belong to two different hosts from the same  
> > > > network.
> > > > 
> > > > My docker commands are as below:
> > > > 
> > > > host1 : $ docker run -t -i --name="master-node-01" -p 9200:9200 -p  
> > > > 9300:9300  
> > > > host2 : $ docker run -t -i --name="master-node-02" -p 9200:9200 -p  
> > > > 9300:9300 (as the host were different, am using the same port for both)
> > > > 
> > > > And I used the configurations as follows:
> > > > 
> > > > host1 : discovery.zen.ping.unicast.hosts: ["host2"]  
> > > > host2 : discovery.zen.ping.unicast.hosts: ["host1"]
> > > > 
> > > > When i tried to start the host2 instance after starting the host1, I  
> > > > cant able connect the host2 with the host1
> > > > 
> > > > and tried some other configurations like
> > > > 
> > > > host1 : discovery.zen.ping.unicast.hosts: ["host2:9200"]  
> > > > host2 : discovery.zen.ping.unicast.hosts: ["host1:9200"]
> > > > 
> > > > host1 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]  
> > > > host2 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]
> > > > 
> > > > But I'm getting the following issues, Is it possible to connect the VMs  
> > > > of different host through ES
> > > > 
> > > > [2014-09-15 09:46:46,920][WARN][transport.netty]  
> > > > [ES\_MASTER\_NODE\_1] exception caught on transport layer [[id: 0x2f06682e]],  
> > > > closing connection  
> > > > java.net.NoRouteToHostException: No route to host  
> > > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > > at sun.nio.ch.SocketChannelImpl.finishConnect(  
> > > > SocketChannelImpl.java:708)  
> > > > at org.elasticsearch.common.netty.channel.socket.nio.  
> > > > NioClientBoss.connect(NioClientBoss.java:150)  
> > > > 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:318)  
> > > > 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)  
> > > > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > > > ThreadPoolExecutor.java:1145)  
> > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > > > ThreadPoolExecutor.java:615)  
> > > > at java.lang.Thread.run(Thread.java:724)
> > > > 
> > > > Any suggestion would be helpful. Thanks in advance.
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%  
> > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/05db482f-5255-4306-88a3-5c408b6a72d5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/05db482f-5255-4306-88a3-5c408b6a72d5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![wzcwts521](https://avatars.discourse-cdn.com/v4/letter/w/c89c15/32.png) [@wzcwts521](https://discuss.elastic.co/u/wzcwts521)\
**Post date:** [February 27, 2015, 5:35pm UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/6 "2015-02-27T17:35:42Z")

</div>

Hi Anand

I am having the same issue, do you have a solution, thanks

On Monday, September 15, 2014 at 4:42:05 AM UTC-7, Anand kumar wrote:

> Thank you Mark for your precious time.
> 
> On Monday, 15 September 2014 17:08:48 UTC+5:30, Mark Walkom wrote:
> 
> > Your problem is a docker networking issue, not an ES one.  
> > I'm not familiar with docker so can't help much more sorry.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 15 September 2014 21:34, Anand kumar [anand...@gmail.com](mailto:anand...@gmail.com) wrote:
> > 
> > > Hi Mark,
> > > 
> > > Thanks for your reply.
> > > 
> > > Yeah, both the hosts belonged to same network.  
> > > I cant able to use telnet, instead I tried ssh.
> > > 
> > > On Monday, 15 September 2014 16:36:53 UTC+5:30, Mark Walkom wrote:
> > > 
> > > > Are they on the same network?  
> > > > Can you telnet to each of the hosts?
> > > > 
> > > > It looks like the two nodes don't have access to each other, hence the  
> > > > no route to host error.
> > > > 
> > > > Regards,  
> > > > Mark Walkom
> > > > 
> > > > Infrastructure Engineer  
> > > > Campaign Monitor  
> > > > email: [ma...@campaignmonitor.com](mailto:ma...@campaignmonitor.com)  
> > > > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > > > 
> > > > On 15 September 2014 21:02, Anand kumar [anand...@gmail.com](mailto:anand...@gmail.com) wrote:
> > > > 
> > > > > Hi all,
> > > > > 
> > > > > ```
> > > > > I'm trying to connect two ES instances using docker VM and both 
> > > > > 
> > > > > ```
> > > > > 
> > > > > as master nodes, but the instances belong to two different hosts from the  
> > > > > same network.
> > > > > 
> > > > > My docker commands are as below:
> > > > > 
> > > > > host1 : $ docker run -t -i --name="master-node-01" -p 9200:9200 -p  
> > > > > 9300:9300  
> > > > > host2 : $ docker run -t -i --name="master-node-02" -p 9200:9200 -p  
> > > > > 9300:9300 (as the host were different, am using the same port for both)
> > > > > 
> > > > > And I used the configurations as follows:
> > > > > 
> > > > > host1 : discovery.zen.ping.unicast.hosts: ["host2"]  
> > > > > host2 : discovery.zen.ping.unicast.hosts: ["host1"]
> > > > > 
> > > > > When i tried to start the host2 instance after starting the host1, I  
> > > > > cant able connect the host2 with the host1
> > > > > 
> > > > > and tried some other configurations like
> > > > > 
> > > > > host1 : discovery.zen.ping.unicast.hosts: ["host2:9200"]  
> > > > > host2 : discovery.zen.ping.unicast.hosts: ["host1:9200"]
> > > > > 
> > > > > host1 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]  
> > > > > host2 : discovery.zen.ping.unicast.hosts: ["xxx.xxx.xx.xx:9200"]
> > > > > 
> > > > > But I'm getting the following issues, Is it possible to connect the  
> > > > > VMs of different host through ES
> > > > > 
> > > > > [2014-09-15 09:46:46,920][WARN][transport.netty]  
> > > > > [ES\_MASTER\_NODE\_1] exception caught on transport layer [[id: 0x2f06682e]],  
> > > > > closing connection  
> > > > > java.net.NoRouteToHostException: No route to host  
> > > > > at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
> > > > > at sun.nio.ch.SocketChannelImpl.finishConnect(  
> > > > > SocketChannelImpl.java:708)  
> > > > > at org.elasticsearch.common.netty.channel.socket.nio.  
> > > > > NioClientBoss.connect(NioClientBoss.java:150)  
> > > > > 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:318)  
> > > > > 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)  
> > > > > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > > > > ThreadPoolExecutor.java:1145)  
> > > > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > > > > ThreadPoolExecutor.java:615)  
> > > > > at java.lang.Thread.run(Thread.java:724)
> > > > > 
> > > > > Any suggestion would be helpful. Thanks in advance.
> > > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google  
> > > > > Groups "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%  
> > > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/d7450d33-b569-493c-8391-e3c68be0cd02%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/4070c285-0b91-43db-b9ee-61e674202a83%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1ef34c13-7890-47f6-a555-52623f587e12%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1ef34c13-7890-47f6-a555-52623f587e12%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:29am UTC](https://discuss.elastic.co/t/how-to-connect-elasticsearch-instance-of-docker-vms-from-two-different-machine/19782/7 "2017-07-06T00:29:27Z")

</div>


