# Elasticsearch docker containers - unable to add second node

**URL:** <https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443>\
**Category:** Elasticsearch\
**Created:** [November 5, 2017, 7:37pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443 "2017-11-05T19:37:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagga13](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@jagga13](https://discuss.elastic.co/u/jagga13)\
**Post date:** [November 5, 2017, 7:37pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443/1 "2017-11-05T19:37:35Z")

</div>

Hello,

I am trying to deploy a 2 node elasticsearch test cluster in docker and was able to get up the first node as the master without any issues but when I try to startup the second es docker container it sees the master but is unable to connect to it:

...  
[2017-11-05T19:17:13,088][WARN][o.e.d.z.ZenDiscovery] [vZOTb7p] failed to connect to master [{ZwL2Awq}{ZwL2Awq6TniXsKKQJfvz2w}{lB-onkBQQ3mUQj08qVQE9g}{172.17.0.3}{172.17.0.3:9300}{ml.enabled=true}], retrying...  
org.elasticsearch.transport.ConnectTransportException: [ZwL2Awq][172.17.0.3: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]  
...

Here is my elasticsearch.yml file:

...  
cluster:  
name: ${CLUSTER\_NAME}

path:  
data: /data/data  
logs: /data/log

bootstrap:  
memory\_lock: true

http:  
enabled: ${HTTP\_ENABLE}  
compression: true  
cors:  
enabled: true  
allow-origin: "/.\*/"

discovery:  
zen:  
minimum\_master\_nodes: 1

network.host: _site_

xpack.security.enabled: false  
node.max\_local\_storage\_nodes: 4  
discovery.zen.ping.unicast.hosts: ["a.a.a.a", "b.b.b.b", "c.c.c.c", "d.d.d.d"]  
...

Any help would be greatly appreciated!

Thanks in advance.

---

<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:** [November 5, 2017, 9:09pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443/2 "2017-11-05T21:09:56Z")

</div>

What does the dockerfile look like?

---

<div class="post-metadata">

**Author:** ![jagga13](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@jagga13](https://discuss.elastic.co/u/jagga13)\
**Post date:** [November 5, 2017, 9:51pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443/3 "2017-11-05T21:51:13Z")

</div>

This is the dockerfile that I used to build this container:

...  
FROM [docker.elastic.co/elasticsearch/elasticsearch:5.5.0](http://docker.elastic.co/elasticsearch/elasticsearch:5.5.0)  
ADD elasticsearch.yml /usr/share/elasticsearch/config/  
USER root  
RUN chown elasticsearch:elasticsearch config/elasticsearch.yml  
USER elasticsearch  
...

Thanks!

---

<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:** [November 5, 2017, 10:42pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443/4 "2017-11-05T22:42:42Z")

</div>

Just a bit of a tip, if you replace the 3 dots you use with ``` (back ticks) you can change the text to code 🙂

We'd definitely suggest using the latest version of Elasticsearch, which is currently 5.6.3. Luckily docker makes that simple to do!

Also have a look at [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html#docker-cli-run-prod-mode](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html#docker-cli-run-prod-mode), specifically just under this section, which provides an example of how to run multiple nodes using docker compose.

---

<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:** [December 3, 2017, 10:42pm UTC](https://discuss.elastic.co/t/elasticsearch-docker-containers-unable-to-add-second-node/106443/5 "2017-12-03T22:42:48Z")

</div>

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