# Elasticsearch version 2.x can not start in docker container but 1.7.3 starts with same config

**URL:** <https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141>\
**Category:** Elasticsearch\
**Created:** [April 12, 2016, 3:37pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141 "2016-04-12T15:37:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajay\_bh111](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ajay\_bh111](https://discuss.elastic.co/u/ajay_bh111)\
**Post date:** [April 12, 2016, 3:37pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/1 "2016-04-12T15:37:24Z")

</div>

Here is the error in elasticsearch logs when docker image build with 2.3.1.

[2016-04-12 14:30:00,083][WARN][rest.suppressed] /\_cluster/health Params: {pretty=true}  
MasterNotDiscoveredException[null]  
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$5.onTimeout(TransportMasterNodeAction.java:226)  
at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:236)  
at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:804)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)  
[2016-04-12 14:30:51,440][WARN][rest.suppressed] /\_cluster/health Params: {pretty=true}  
MasterNotDiscoveredException[null]  
at org.elasticsearch.action.support.master.TransportMasterNodeAction$AsyncSingleAction$5.onTimeout(TransportMasterNodeAction.java:226)  
at org.elasticsearch.cluster.ClusterStateObserver$ObserverClusterStateListener.onTimeout(ClusterStateObserver.java:236)  
at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:804)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)

Config File: elasticsearch.yml  
[cluster.name](http://cluster.name): ${ES\_ENV\_CLUSTER\_NAME}  
[node.name](http://node.name): ${HOSTNAME}  
path.conf: ${ES\_ENV\_PATH\_CONF}  
path.data: ${ES\_ENV\_PATH\_DATA}  
path.work: ${ES\_ENV\_PATH\_WORK}  
path.logs: ${ES\_ENV\_PATH\_LOGS}  
path.plugins: ${ES\_ENV\_HOME}/plugins  
bootstrap.mlockall: true  
http.port: 9200  
node.master: true  
node.data: true  
discovery.zen.ping.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["${ES\_ENV\_M1}:9300","${ES\_ENV\_M2}:9300","${ES\_ENV\_M3}:9300"]  
indices.memory.index\_buffer\_size: 50%  
discovery.zen.fd.ping\_timeout: 30s  
indices.fielddata.cache.size: 25%  
action.disable\_delete\_all\_indices: true  
indices.cluster.send\_refresh\_mapping: false  
cluster.routing.allocation.cluster\_concurrent\_rebalance: 2  
cluster.routing.allocation.disk.threshold\_enabled: true  
cluster.routing.allocation.disk.watermark.low: .90  
cluster.routing.allocation.disk.watermark.high: .95  
cluster.routing.allocation.node\_concurrent\_recoveries: 4  
cluster.routing.allocation.node\_initial\_primaries\_recoveries: 10  
indices.store.throttle.max\_bytes\_per\_sec: 200mb  
threadpool.index.queue\_size: 500  
threadpool.bulk.queue\_size: 500  
http.max\_content\_length: 500mb  
network.host: 0.0.0.0

Environment:  
ES\_ENV\_PATH\_LOGS=/es/logs  
HOSTNAME=es03  
ES\_ENV\_HOME=/usr/local/elasticsearch  
ES\_ENV\_PATH\_WORK=/es/work  
ES\_ENV\_M1=es01  
ES\_ENV\_M2=es02  
ES\_ENV\_M3=es03  
JAVA\_HOME=/usr/lib/jvm/java-8-oracle  
ES\_ENV\_PATH\_PLUGINS=/usr/local/elasticsearch/plugins  
ES\_ENV\_CONFIG=/es/config/elasticsearch.yml  
ES\_ENV\_PATH\_DATA=/es/data  
ES\_ENV\_PATH\_CONF=/es/config  
ES\_ENV\_CLUSTER\_NAME=es\_test

Cluster Health when launched with 1.7.3:  
elasticsearch@es03:/es/config$ curl -XGET '[http://localhost:9200/\_cluster/health?pretty=true](http://localhost:9200/_cluster/health?pretty=true)'  
{  
"cluster\_name" : "es\_test",  
"status" : "green",  
"timed\_out" : false,  
"number\_of\_nodes" : 3,  
"number\_of\_data\_nodes" : 3,  
"active\_primary\_shards" : 0,  
"active\_shards" : 0,  
"relocating\_shards" : 0,  
"initializing\_shards" : 0,  
"unassigned\_shards" : 0,  
"delayed\_unassigned\_shards" : 0,  
"number\_of\_pending\_tasks" : 0,  
"number\_of\_in\_flight\_fetch" : 0  
}

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 12, 2016, 6:03pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/2 "2016-04-12T18:03:35Z")

</div>

> [@ajay\_bh111](#):
>
> discovery.zen.ping.unicast.hosts: ["${ES\_ENV\_M1}:9300","${ES\_ENV\_M2}:9300","${ES\_ENV\_M3}:9300"]

Do you have three containers (one for each master) under the same VM? Or a single container running three ES nodes?

If three separate containers are involved then have you tried the setting

> network.publish\_host=$(docker-machine ip default)

---

<div class="post-metadata">

**Author:** ![ajay\_bh111](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ajay\_bh111](https://discuss.elastic.co/u/ajay_bh111)\
**Post date:** [April 12, 2016, 6:27pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/3 "2016-04-12T18:27:40Z")

</div>

They are on 3 different VMs. Network.host setting has been used with all interfaces as 0.0.0.0 so does it still need publish host setting?

ThanksAjay **From:** abhijat **Sent:** Tuesday, April 12, 2016 2:13 PM **To:** [ajay.bh111@gmail.com](mailto:ajay.bh111@gmail.com) **Reply To:** Discuss Elasticsearch Logstash and Kibana | Elastic **Subject:** [Elasticsearch] Elasticsearch version 2.x can not start in docker container but 1.7.3 starts with same config

![](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d6d399d01c938cc41591cf4e54c2a9bf9e7b3a7a.png "abhijat")[abhijat](http://discuss.elastic.co/users/abhijat)

April 12 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/7/976a8388b207be88e919f13ec07b626693764260.png)ajay\_bh111:

> discovery.zen.ping.unicast.hosts: ["${ES\_ENV\_M1}:9300","${ES\_ENV\_M2}:9300","${ES\_ENV\_M3}:9300"]

Do you have three containers (one for each master) under the same VM? Or a single container running three ES nodes?

If three separate containers are involved then have you tried the setting

> network.publish\_host=$(docker-machine ip default)

* * *

[Visit Topic](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/2) or reply to this email to respond

To stop receiving notifications for this particular topic, [click here](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/unsubscribe). To unsubscribe from these emails, change your [user preferences](http://discuss.elastic.co/my/preferences)

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 12, 2016, 7:22pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/4 "2016-04-12T19:22:34Z")

</div>

Yes, I believe, you need to specifically set network.publish\_host to the IP of the VM for other nodes to see it. I think there was a regression that got introduced with ES 2.2.0 around this and was subsequently fixed in 2.3.0. Try it.

> <https://github.com/elastic/elasticsearch/pull/16626>

> <https://github.com/elastic/elasticsearch/pull/14535>

---

<div class="post-metadata">

**Author:** ![ajay\_bh111](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ajay\_bh111](https://discuss.elastic.co/u/ajay_bh111)\
**Post date:** [April 13, 2016, 2:42pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/5 "2016-04-13T14:42:54Z")

</div>

Setting network.publish\_host: _cali0:ipv4_ did not help with 2.3.0 but  
worked with elasticsearch 1.7.3 (which worked without it too).

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 13, 2016, 5:29pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/6 "2016-04-13T17:29:34Z")

</div>

> [@ajay\_bh111](#):
>
> discovery.zen.ping.unicast.hosts: ["${ES\_ENV\_M1}:9300","${ES\_ENV\_M2}:9300","${ES\_ENV\_M3}:9300"]

What is the IP address used for ES\_ENV\_M1, ES\_ENV\_M3 and ES\_ENV\_M3? It should be the IP address of the VMs on which the ES containers are running...

Also, cali0, should be the NIC of the VM on which the container is running.

---

<div class="post-metadata">

**Author:** ![ajay\_bh111](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ajay\_bh111](https://discuss.elastic.co/u/ajay_bh111)\
**Post date:** [April 13, 2016, 5:43pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/7 "2016-04-13T17:43:49Z")

</div>

These are docker containers with networking and ports 9200, 9300 are exposed between vms.

IP addresses are allocated by calico networking for docker containers. Container nodes IP can telnet to other containers on ports 9200 and 9300.

ThanksAjay **From:** abhijat **Sent:** Wednesday, April 13, 2016 1:39 PM **To:** [ajay.bh111@gmail.com](mailto:ajay.bh111@gmail.com) **Reply To:** Discuss Elasticsearch Logstash and Kibana | Elastic **Subject:** [Elasticsearch] Elasticsearch version 2.x can not start in docker container but 1.7.3 starts with same config

![](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d6d399d01c938cc41591cf4e54c2a9bf9e7b3a7a.png "abhijat")[abhijat](http://discuss.elastic.co/users/abhijat)

April 13 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/7/976a8388b207be88e919f13ec07b626693764260.png)ajay\_bh111:

> discovery.zen.ping.unicast.hosts: ["${ES\_ENV\_M1}:9300","${ES\_ENV\_M2}:9300","${ES\_ENV\_M3}:9300"]

What is the IP address used for ES\_ENV\_M1, ES\_ENV\_M3 and ES\_ENV\_M3? It should be the IP address of the VMs on which the ES containers are running...

Also, cali0, should be the NIC of the VM on which the container is running.

* * *

[Visit Topic](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/6) or reply to this email to respond

To stop receiving notifications for this particular topic, [click here](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/unsubscribe). To unsubscribe from these emails, change your [user preferences](http://discuss.elastic.co/my/preferences)

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 13, 2016, 6:05pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/8 "2016-04-13T18:05:27Z")

</div>

Here is what I have done:

I have two VMs created on my Mac. One with IP address `1.2.3.1` and the other with `1.2.3.2`.

elasticsearch.yml:

```
cluster.name: es-local
network.host: ["_site:ipv4_", "_local:ipv4_"]

http.port: 9200
http.publish_port: 9200
http.compression: true
http.cors.enabled: true
http.cors.allow-credentials: true
http.cors.allow-origin: /.*/

transport.tcp.compress: true
transport.tcp.port: 9300
transport.publish_port: 9300

discovery.zen.ping_timeout: 10s
discovery.zen.join_timeout: 60s

script.groovy.sandbox.enabled: true

discovery.zen.ping.unicast.hosts: [1.2.3.1:9300]

```

On `VM1 (1.2.3.1)` and `VM2 (1.2.3.2)`, I started ES node with above YML file using the command:

```
docker run -d -it -p 9200:9200 -p 9300:9300 \
    -v $HOME/elasticsearch/standalone/data:/var/lib/elasticsearch \
    -v $HOME/elasticsearch/standalone/log:/var/log/elasticsearch \
$MY_ES2X_DOCKER_IMAGE

```

And both ES nodes are able to connect to each other.

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 13, 2016, 6:30pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/9 "2016-04-13T18:30:26Z")

</div>

Whatever you use, you need to make sure that the IP address and ports for the VMs are properly set for `discovery.zen.ping.unicast.hosts` and that those are visible to other VMs and their corresponding containers.

---

<div class="post-metadata">

**Author:** ![ajay\_bh111](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@ajay\_bh111](https://discuss.elastic.co/u/ajay_bh111)\
**Post date:** [April 13, 2016, 6:44pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/10 "2016-04-13T18:44:50Z")

</div>

Network connectivity is not issue. Another difference VMs are on different physical hypervisors. Probably ES is not handling multiple network interfaces on the containers correctly.

**From:** abhijat **Sent:** Wednesday, April 13, 2016 2:40 PM **To:** [ajay.bh111@gmail.com](mailto:ajay.bh111@gmail.com) **Reply To:** Discuss Elasticsearch Logstash and Kibana | Elastic **Subject:** [Elasticsearch] Elasticsearch version 2.x can not start in docker container but 1.7.3 starts with same config

![](https://us1.discourse-cdn.com/elastic/original/3X/d/6/d6d399d01c938cc41591cf4e54c2a9bf9e7b3a7a.png "abhijat")[abhijat](http://discuss.elastic.co/users/abhijat)

April 13

Whatever you use, you need to make sure that the IP address and ports for the VMs are properly set for `discovery.zen.ping.unicast.hosts` and that those are visible to other VMs and their corresponding containers.

[Visit Topic](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/9) or reply to this email to respond

* * *

#### In Reply To
![|45x45](upload://uErwWzIu5UT2wyElBJT9IDiX3qW.png "abhijat")[abhijat](http://discuss.elastic.co/users/abhijat)

April 13Here is what I have done:

I have two VMs created on my Mac. One with IP address 1.2.3.1 and the other with 1.2.3.2.

Elasticsearch.yml:

cluster.name: es-local  
network.host: ["_site:ipv4_", "_local:ipv4_"]

http.port: 9200  
http.publish\_port: 9200  
http.compression: true  
http.cors.enabled: true  
ht…

* * *

[Visit Topic](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/9) or reply to this email to respond

To stop receiving notifications for this particular topic, [click here](http://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/unsubscribe). To unsubscribe from these emails, change your [user preferences](http://discuss.elastic.co/my/preferences)

---

<div class="post-metadata">

**Author:** ![abhijat](https://avatars.discourse-cdn.com/v4/letter/a/9de0a6/32.png) [@abhijat](https://discuss.elastic.co/u/abhijat)\
**Post date:** [April 13, 2016, 7:10pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/11 "2016-04-13T19:10:56Z")

</div>

It shouldnt matter IMO. In your case you have to specify the IP address of the machines on which the containers are executing. Say, you have two physically separate boxes host1 and host2, then you need to put the IP address and port of the host1 and host2 in your YML files.

Let us take a simple case... have you tried starting only a single instance of ES 2.3 on one of these boxes and tried to access via the browser? something like [http://host1:9200/](http://host1:9200/)? And if it works then what value do you specify for host1?

---

<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 5, 2017, 10:59pm UTC](https://discuss.elastic.co/t/elasticsearch-version-2-x-can-not-start-in-docker-container-but-1-7-3-starts-with-same-config/47141/12 "2017-07-05T22:59:29Z")

</div>


