# Elasticsearch in Docker Master Discovery

**URL:** https://discuss.elastic.co/t/elasticsearch-in-docker-master-discovery/140691
**Category:** Elasticsearch
**Created:** [July 19, 2018, 8:40am UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-master-discovery/140691 "2018-07-19T08:40:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [July 19, 2018, 8:40am UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-master-discovery/140691/1 "2018-07-19T08:40:48Z")

</div>

Hi,  
I'm testing running elasticsearch in a docker container. I want to see it join an existing, non-docker, cluster. The service starts but fails to discover master nodes. Can someone help me understand the issue here?

I'm launching elasticsearch like this:

```
/usr/bin/docker run \
-p 9200:9200 \
-p 9300:9300 \
-a STDOUT \
-a STDERR \
--name elasticsearch_lab \
--mount type=bind,source=/opt/elasticsearch,target=${ES_HOME}/data \
--mount type=bind,source=/var/log/elasticsearch,target=${ES_HOME}/logs \
--mount type=bind,source=/etc/elasticsearch,target=${ES_HOME}/config \
--mount type=bind,source=/etc/default,target=/etc/default \
--ulimit nofile=65536:65536 \
--ulimit memlock=-1:-1 \
--network host \
$DOCKER_IMAGE \
--quiet \
-Edefault.path.logs=${ES_HOME}/logs \
-Edefault.path.data=${ES_HOME}/data \
-Edefault.path.conf=${ES_HOME}/config

```

The elasticsearch log looks like this:

> [2018-07-19T08:02:20,192][INFO][o.e.n.Node] [test\_node1] version[5.6.10], pid[1], build[b727a60/2018-06-06T15:48:34.860Z], OS[Linux/4.4.0-71-generic/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0\_171/25.171-b11]  
> [2018-07-19T08:02:20,192][INFO][o.e.n.Node] [test\_node1] JVM arguments [-Xms1024m, -Xmx1024m, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -Djdk.io.permissionsUseCanonicalPath=true, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j.skipJansi=true, -XX:+HeapDumpOnOutOfMemoryError, -Des.path.home=/usr/share/elasticsearch]  
> [2018-07-19T08:02:23,051][INFO][o.e.p.PluginsService] [test\_node1] loaded module [aggs-matrix-stats]  
> [2018-07-19T08:02:23,051][INFO][o.e.p.PluginsService] [test\_node1] loaded module [ingest-common]  
> [2018-07-19T08:02:23,051][INFO][o.e.p.PluginsService] [test\_node1] loaded module [lang-expression]  
> [2018-07-19T08:02:23,051][INFO][o.e.p.PluginsService] [test\_node1] loaded module [lang-groovy]  
> [2018-07-19T08:02:23,051][INFO][o.e.p.PluginsService] [test\_node1] loaded module [lang-mustache]  
> [2018-07-19T08:02:23,052][INFO][o.e.p.PluginsService] [test\_node1] loaded module [lang-painless]  
> [2018-07-19T08:02:23,052][INFO][o.e.p.PluginsService] [test\_node1] loaded module [parent-join]  
> [2018-07-19T08:02:23,052][INFO][o.e.p.PluginsService] [test\_node1] loaded module [percolator]  
> [2018-07-19T08:02:23,052][INFO][o.e.p.PluginsService] [test\_node1] loaded module [reindex]  
> [2018-07-19T08:02:23,053][INFO][o.e.p.PluginsService] [test\_node1] loaded module [transport-netty3]  
> [2018-07-19T08:02:23,053][INFO][o.e.p.PluginsService] [test\_node1] loaded module [transport-netty4]  
> [2018-07-19T08:02:23,058][INFO][o.e.p.PluginsService] [test\_node1] loaded plugin [discovery-ec2]  
> [2018-07-19T08:02:23,058][INFO][o.e.p.PluginsService] [test\_node1] loaded plugin [mapper-size]  
> [2018-07-19T08:02:23,058][INFO][o.e.p.PluginsService] [test\_node1] loaded plugin [repository-s3]  
> [2018-07-19T08:02:25,951][INFO][o.e.d.DiscoveryModule] [test\_node1] using discovery type [zen]  
> [2018-07-19T08:02:27,313][INFO][o.e.n.Node] [test\_node1] initialized  
> [2018-07-19T08:02:27,314][INFO][o.e.n.Node] [test\_node1] starting ...  
> [2018-07-19T08:02:27,609][INFO][o.e.t.TransportService] [test\_node1] publish\_address {\<ip\_addr\>:9300}, bound\_addresses {\<ip\_addr\>:9300}  
> [2018-07-19T08:02:27,629][INFO][o.e.b.BootstrapChecks] [test\_node1] bound or publishing to a non-loopback address, enforcing bootstrap checks  
> [2018-07-19T08:02:30,719][WARN][o.e.d.z.ZenDiscovery] [test\_node1] not enough master nodes discovered during pinging (found [], but needed [2]), pinging again

Regards,  
D

---

<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: [August 16, 2018, 8:40am UTC](https://discuss.elastic.co/t/elasticsearch-in-docker-master-discovery/140691/2 "2018-08-16T08:40:50Z")

</div>

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