# Elasticsearch 5.1.1 2nodes cluster, started with docker are not able to see each other

**URL:** https://discuss.elastic.co/t/elasticsearch-5-1-1-2nodes-cluster-started-with-docker-are-not-able-to-see-each-other/69044
**Category:** Elasticsearch
**Created:** [December 14, 2016, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-1-2nodes-cluster-started-with-docker-are-not-able-to-see-each-other/69044 "2016-12-14T16:10:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![cruizpollino](https://avatars.discourse-cdn.com/v4/letter/c/6a8cbe/32.png) [@cruizpollino](https://discuss.elastic.co/u/cruizpollino)
#### Post date: [December 14, 2016, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-1-2nodes-cluster-started-with-docker-are-not-able-to-see-each-other/69044/1 "2016-12-14T16:10:29Z")

</div>

Good evening everyone,

I've two virtual machines [rmavmdcos4.mad.roche.com](http://rmavmdcos4.mad.roche.com) and [rmavmdcos5.mad.roche.com](http://rmavmdcos5.mad.roche.com) (10.120.1.190 and 191)

With docker 1.12 installed on them

I'm trying to set an elasticsearch 5.1.1 cluster running docker images on each node.

I've followed instructions detailed at  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-cluster-composefile](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-cluster-composefile)

In order to generate the custom image, but we're not able to use docker compose as detailed in the web page

**[root@rmavmdcos4 config]# cat Dockerfile**  
FROM [docker.elastic.co/elasticsearch/elasticsearch:5.1.1](http://docker.elastic.co/elasticsearch/elasticsearch:5.1.1)  
ADD elasticsearch.yml /usr/share/elasticsearch/config/  
USER root  
RUN chown elasticsearch:elasticsearch /usr/share/elasticsearch/config/elasticsearch.yml  
ADD log4j2.properties /usr/share/elasticsearch/config/  
USER root  
RUN chown elasticsearch:elasticsearch /usr/share/elasticsearch/config/log4j2.properties  
USER elasticsearch

**[root@rmavmdcos4 config]# cat elasticsearch.yml**  
cluster.name: elasticcluster  
bootstrap.memory\_lock: true  
node.name: {HOSTNAME} network.host: {HOSTNAME}  
node.add\_lock\_id\_to\_custom\_path: false  
path:  
conf: /usr/share/elasticsearch/config  
data: /usr/share/elasticsearch/data  
logs: /usr/share/elasticsearch/data  
shared\_data: /usr/share/elasticsearch/data  
discovery.zen.minimum\_master\_nodes: 1  
discovery.zen.ping.unicast.hosts:  
- 10.120.1.190  
- 10.120.1.191  
node.max\_local\_storage\_nodes: 10

**[root@rmavmdcos4 config]# cat log4j2.properties**  
status = error  
appender.console.type = Console  
appender.console.name = console  
appender.console.layout.type = PatternLayout  
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n  
rootLogger.level = info  
rootLogger.appenderRef.console.ref = console

[root@rmavmdcos4 config]# docker build --tag=elasticsearch-custom .

When I ran;

[root@rmavmdcos4 config]# docker -D -H unix:///var/run/docker.sock run --cap-add=IPC\_LOCK --ulimit memlock=-1:-1 --ulimit nofile=65536:65536 --cpu-shares 1024 --memory 2634022912 -e ES\_JAVA\_OPTS="-Xms2G -Xmx2G" -v /system/mesosf/elasticsearch/data:/usr/share/elasticsearch/data/:rw --net bridge -p 9200:9200/tcp -p 9300:9300/tcp elasticsearch-custom

The cluster starts and its accessible

But when I ran same command on second node(rmavmdcos5), it fails reporting

DEBU[0023] framesize: 2624  
[2016-12-14T15:22:07,257][WARN][o.e.d.z.ZenDiscovery] [8c46fe4012bc] failed to connect to master [{c34da5043b02}{5kbMnV01SwKM59PPBX-ouw}{_4mkX7JcS_-clhnQOERUJg}{c34da5043b02}{172.17.0.2:9300}], retrying...  
org.elasticsearch.transport.ConnectTransportException: [c34da5043b02][172.17.0.2:9300] connect\_timeout[30s]  
at org.elasticsearch.transport.netty4.Netty4Transport.connectToChannels(Netty4Transport.java:379) ~[?:?]

Problem seems to be that the elastic nodes are running on IP's like 172.17.0.x, and the information detailed on unicast.host are the real IP of the virtual hosts

Anyone knows how to set the unicast host or adapt the elasticsearch.yaml file in order to make both nodes see each other?

Any idea will be welcome

Thanks in advance for your time and help

## Regards

 ![](https://us1.discourse-cdn.com/elastic/original/2X/2/2efc54470b90626d50a8ac70e832ba82a4403d95.PNG)  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/93bcbb94aa101824039896f6555288031978f5f0.PNG)

---

<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: [January 11, 2017, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-5-1-1-2nodes-cluster-started-with-docker-are-not-able-to-see-each-other/69044/2 "2017-01-11T16:10:32Z")

</div>

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