# Master not discovered execption on elasticsearch 5.0.0

**URL:** <https://discuss.elastic.co/t/master-not-discovered-execption-on-elasticsearch-5-0-0/65627>\
**Category:** Elasticsearch\
**Created:** [November 10, 2016, 10:11am UTC](https://discuss.elastic.co/t/master-not-discovered-execption-on-elasticsearch-5-0-0/65627 "2016-11-10T10:11:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![girishramnani](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/girishramnani/32/13083_2.png) [@girishramnani](https://discuss.elastic.co/u/girishramnani)\
**Post date:** [November 10, 2016, 10:11am UTC](https://discuss.elastic.co/t/master-not-discovered-execption-on-elasticsearch-5-0-0/65627/1 "2016-11-10T10:11:55Z")

</div>

Hello,  
I am trying to create a 3 node elasticsearch 5.0 cluster on digital ocean. I am using systemd to run elasticsearch and each elasticsearch instance runs inside a docker container ( the official elasticsearch container ). This is the elasticsearch config file

> <https://gist.github.com/girishramnani/f5f9a425e7ad986ce746117da62dd831>

And this is the `ExecStart` portion of the unit file

```
ExecStart=/bin/sh -c '/usr/bin/docker run -v /home/core/esdata:/usr/share/elasticsearch/data --rm --name elasticsearch-${instance_index} \            
             -e ES_HOSTS="elasticsearch-3,elasticsearch-2,elasticsearch-1," \
             -e MIN_MASTER_NODES="2" \
             -e NUM_REPLICAS="1" \
             -p 9200:9200 -p 9300:9300 elasticsearch:5 \
            /bin/sh -c \'chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data ; \
            gosu elasticsearch elasticsearch \''

```

After all the 3 nodes start, none of them are able to connect and a **master not discovered error** shows on health check. This is the error trace.

> <https://gist.github.com/girishramnani/0dabde87ffada26df7f658ff34f09ba1>

The `ES_HOSTS` variable is set in the env as `elasticsearch-3,elasticsearch-2,elasticsearch-1,`.  
This is the complete env inside the elasticsearch containers.

```
HOSTNAME=elasticsearch-1
ES_HOSTS=elasticsearch-3,elasticsearch-2,elasticsearch-1,
NUM_REPLICAS=1
CA_CERTIFICATES_JAVA_VERSION=20140324
PATH=/usr/share/elasticsearch/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WEAVE_CIDR=192.168.16.1/24
PWD=/usr/share/elasticsearch
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
LANG=C.UTF-8
JAVA_VERSION=8u111
SHLVL=1
HOME=/root
JAVA_DEBIAN_VERSION=8u111-b14-2~bpo8+1
MIN_MASTER_NODES=2
ELASTICSEARCH_VERSION=5.0.0
GOSU_VERSION=1.7
_=/usr/bin/env

```

and from inside the container I can reach the other elasticsearch instances i.e. from elasticsearch-1 i can reach elasticsearch-2

```
curl http://elasticsearch-2:9200                                                                  
{
  "name" : "xGIB2_i",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "_na_",
  "version" : {
    "number" : "5.0.0",
    "build_hash" : "253032b",
    "build_date" : "2016-10-26T05:11:34.737Z",
    "build_snapshot" : false,
    "lucene_version" : "6.2.0"
  },
  "tagline" : "You Know, for Search"
}

```

### System specification

OS - CoreOS  
version - stable (1185.3)

---

<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 8, 2016, 10:12am UTC](https://discuss.elastic.co/t/master-not-discovered-execption-on-elasticsearch-5-0-0/65627/2 "2016-12-08T10:12:06Z")

</div>

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