# Discovery in multi node cluster using docker compose

**URL:** <https://discuss.elastic.co/t/discovery-in-multi-node-cluster-using-docker-compose/343199>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [September 17, 2023, 3:05pm UTC](https://discuss.elastic.co/t/discovery-in-multi-node-cluster-using-docker-compose/343199 "2023-09-17T15:05:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoyceBabu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joycebabu/32/22914_2.png) [@JoyceBabu](https://discuss.elastic.co/u/JoyceBabu)\
**Post date:** [September 17, 2023, 3:05pm UTC](https://discuss.elastic.co/t/discovery-in-multi-node-cluster-using-docker-compose/343199/1 "2023-09-17T15:05:17Z")

</div>

I am trying to create a three node ElasticSEarch cluster following the tutorial

> **[Install Elasticsearch with Docker | Elasticsearch Guide \[8.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/docker.html#docker-compose-file)**

When I set `cluster.initial_master_nodes` to `es1,es2,es3`, I am getting the warning

> this node is locked into cluster UUID [lUWf3vbtRcarnQXNd6rnjA] but [cluster.initial\_master\_  
> nodes] is set to [es1, es2, es3]; remove this setting to avoid possible data loss caused by subsequent cluster bootstrap attempts; for further information see [https://www.ela](https://www.ela)  
> [HTTP 오류 404 - 페이지를 찾을 수 없음.](http://stic.co/guide/en/elasticsearch/reference/8.9/important-settings.html#initial_master_nodes)

But, if I remove them I am getting the error

> "master not discovered yet, this node has not previously joined a bootstrapped cluster, and [cluster.initial\_master\_nodes] is empty on this node: have discovered [{es3}{Qxw8OO4\_RtKFtPEkdnk-EA}{SWhx6iLCT3eng13g3rcGzQ}{es3}{172.23.0.16}{172.23.0.16:9300}{cdfhilmrstw}{8.9.2}, {es1}{1Xkq3FdiTwSZV2Fn3F-WRg}{jruwU2IRQPafSeISMkCYrw}{es1}{172.23.0.14}{172.23.0.14:9300}{cdfhilmrstw}{8.9.2}, {es2}{51jDr41CSJ6CVNrijScFwA}{uVQdP0sJSbG7O2tZeNDrPA}{es2}{172.23.0.15}{172.23.0.15:9300}{cdfhilmrstw}{8.9.2}]; discovery will continue using [172.30.0.4:9300, 172.30.0.2:9300] from hosts providers and [{es3}{Qxw8OO4\_RtKFtPEkdnk-EA}{SWhx6iLCT3eng13g3rcGzQ}{es3}{172.23.0.16}{172.23.0.16:9300}{cdfhilmrstw}{8.9.2}] from last-known cluster state; node term 0, last-accepted version 0 in term 0; for troubleshooting guidance, see [Troubleshooting discovery | Elasticsearch Guide [8.9] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/discovery-troubleshooting.html)

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 17, 2023, 3:44pm UTC](https://discuss.elastic.co/t/discovery-in-multi-node-cluster-using-docker-compose/343199/2 "2023-09-17T15:44:31Z")

</div>

Hi @JoyceBabu Welcome to the community!

Did you just try this [here](https://www.elastic.co/guide/en/elasticsearch/reference/8.9/docker.html#docker-compose-file) .env plus the docker-compose.yml as provided.

> <https://github.com/elastic/elasticsearch/blob/8.9/docs/reference/setup/install/docker/docker-compose.yml>

That should work out of the box by just configuring the `.env` file I would not change settings if you are just learning.

However, if you've already started it incorrectly or it failed, you should remove everything before you try again Make sure all the containers and volume mounts are removed.

---

<div class="post-metadata">

**Author:** ![JoyceBabu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joycebabu/32/22914_2.png) [@JoyceBabu](https://discuss.elastic.co/u/JoyceBabu)\
**Post date:** [September 26, 2023, 3:21pm UTC](https://discuss.elastic.co/t/discovery-in-multi-node-cluster-using-docker-compose/343199/3 "2023-09-26T15:21:38Z")

</div>

Thank you for your response @stephenb

I did manage to resolve it. I don't remember what the exact issue was, I think I was reusing the same volume for all three container.

---

<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:** [October 24, 2023, 3:22pm UTC](https://discuss.elastic.co/t/discovery-in-multi-node-cluster-using-docker-compose/343199/4 "2023-10-24T15:22:02Z")

</div>

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