# Multi host elasticsearch cluster using docker

**URL:** <https://discuss.elastic.co/t/multi-host-elasticsearch-cluster-using-docker/186561>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [June 20, 2019, 12:36am UTC](https://discuss.elastic.co/t/multi-host-elasticsearch-cluster-using-docker/186561 "2019-06-20T00:36:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nila](https://avatars.discourse-cdn.com/v4/letter/n/b2d939/32.png) [@nila](https://discuss.elastic.co/u/nila)\
**Post date:** [June 20, 2019, 12:36am UTC](https://discuss.elastic.co/t/multi-host-elasticsearch-cluster-using-docker/186561/1 "2019-06-20T00:36:52Z")

</div>

Hello everyone,

I am trying to configure elasticsearch cluster on docker with 3 different hosts which are identical. Any one of these should be master/data nodes. I have the following docker-compose.yml file. I am getting error master node not found and bootstrap cluster discovery shows empty. Can some one please check and see where I am doing wrong? I have tried replacing host1,host2, host3 with IP and FQDN with no luck. I can reach host1, host2, host3 external to docker container.

## docker-compose.yml:

version: '2.2'  
services:  
es01:  
image: [docker.elastic.co/elasticsearch/elasticsearch:7.1.1](http://docker.elastic.co/elasticsearch/elasticsearch:7.1.1)  
container\_name: es01  
environment:  
- node.name=host1  
- node.data=true  
- discovery.seed\_hosts=host1,host2,host3  
- cluster.initial\_master\_nodes=host1,host2,host3  
- cluster.name=ELK\_Prod  
- node.master=true  
- bootstrap.memory\_lock=true  
- "ES\_JAVA\_OPTS=-Xms1024m -Xmx1024m"  
- Des.discovery.zen.ping.unicast.hosts=host1,host2,host3  
- Des.discovery.zen.minimum\_master\_nodes=1  
- Des.network.publish\_host=host1  
- transport.tcp.port=9300  
- http.port=9200  
ulimits:  
memlock:  
soft: -1  
hard: -1  
volumes:  
- esdata01:/elkstack/elasticsearch/elasticsearch-7.1.1/data  
networks:  
- esnet1

volumes:  
esdata01:  
driver: local

networks:  
esnet1:

## Warning Message:

{"type": "server", "timestamp": "2019-06-20T00:34:03,059+0000", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "ELK\_Prod", "node.name": "host1", "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [host1,host2,host3] to bootstrap a cluster: have discovered ; discovery will continue using [152.102.42.172:9300, 152.102.42.170:9300, 152.102.28.45:9300] from hosts providers and [{host1}{lP8KDiM8Q9WdOFqFIWvRxQ}{Il7ncUxWTsKUWxhaDn6tCQ}{172.20.0.2}{172.20.0.2:9300}{ml.machine\_memory=25092349952, xpack.installed=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

Thanks

---

<div class="post-metadata">

**Author:** ![MiTschMR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mitschmr/32/48254_2.png) [@MiTschMR](https://discuss.elastic.co/u/MiTschMR)\
**Post date:** [June 24, 2019, 12:24pm UTC](https://discuss.elastic.co/t/multi-host-elasticsearch-cluster-using-docker/186561/2 "2019-06-24T12:24:28Z")

</div>

Hi @nila

I assume you are trying to do it with Docker-Compose, correct? What I would do is the following:  
Make a service for each host you want to run as part of the ELK-Stack. You can use the configuration file (docker-compose.yml) provided in [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run) guide.

Hope this helps.

MiTschMR

---

<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 22, 2019, 12:24pm UTC](https://discuss.elastic.co/t/multi-host-elasticsearch-cluster-using-docker/186561/3 "2019-07-22T12:24:34Z")

</div>

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