# Setting up ES multi-node on multiple hosts

**URL:** https://discuss.elastic.co/t/setting-up-es-multi-node-on-multiple-hosts/360063
**Category:** Elasticsearch
**Tags:** docker
**Created:** [May 23, 2024, 9:22am UTC](https://discuss.elastic.co/t/setting-up-es-multi-node-on-multiple-hosts/360063 "2024-05-23T09:22:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hugo\_Perez\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_perez_fernandez/32/126770_2.png) [@Hugo\_Perez\_Fernandez](https://discuss.elastic.co/u/Hugo_Perez_Fernandez)
#### Post date: [May 23, 2024, 9:22am UTC](https://discuss.elastic.co/t/setting-up-es-multi-node-on-multiple-hosts/360063/1 "2024-05-23T09:22:18Z")

</div>

Hi all,

When creating an Elasticsearch cluster using Docker with multiple nodes, where each one runs on its own host, a problem arises when forming the cluster when the containers are raised, because it cannot be formed correctly due to not being able to perform the discovery between the nodes.

In the case of using a Host or Bridge type network, it is generated because the values of the Discovery.seed\_hosts and cluster.initial\_master\_nodes properties do not match those of the containers.

Could you suggest a way to solve this problem?

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [May 23, 2024, 12:24pm UTC](https://discuss.elastic.co/t/setting-up-es-multi-node-on-multiple-hosts/360063/2 "2024-05-23T12:24:42Z")

</div>

Check this [answer](https://discuss.elastic.co/t/elasticsearch-cluster-across-multiple-docker-hosts/358314/2) on a similar question.

Basically you need to have the `network.publish_host` with the IP address of your docker host, and also use `network.bind_host` as `0.0.0.0`.

Something like this in each compose:

```auto
- network.bind_host=0.0.0.0
- network.publish_host=DOCKER-HOST-IP

```

The documentation for these settings are [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html#advanced-network-settings).

---

<div class="post-metadata">

### Author: ![Hugo\_Perez\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hugo_perez_fernandez/32/126770_2.png) [@Hugo\_Perez\_Fernandez](https://discuss.elastic.co/u/Hugo_Perez_Fernandez)
#### Post date: [May 24, 2024, 6:58am UTC](https://discuss.elastic.co/t/setting-up-es-multi-node-on-multiple-hosts/360063/3 "2024-05-24T06:58:56Z")

</div>

Thank you very much for the help 🙂
