# Zen Discovery and the transport ports

**URL:** https://discuss.elastic.co/t/zen-discovery-and-the-transport-ports/166194
**Category:** Elasticsearch
**Created:** [January 29, 2019, 2:51pm UTC](https://discuss.elastic.co/t/zen-discovery-and-the-transport-ports/166194 "2019-01-29T14:51:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![darefilz](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@darefilz](https://discuss.elastic.co/u/darefilz)
#### Post date: [January 29, 2019, 2:51pm UTC](https://discuss.elastic.co/t/zen-discovery-and-the-transport-ports/166194/1 "2019-01-29T14:51:39Z")

</div>

Hi,

I maybe fail to understand the principles of zen discovery. But I can not make the Elasticsearch nodes join the cluster.

Info:

- All Elasticsearch nodes live in Docker containers
- Everything happens on my local machine for testing purpose

Now I want 2 master-only nodes to form a cluster. Here the relevant part of the config:

```auto
network.bind_host: 0.0.0.0
network.publish_host: 10.50.15.26 <– my local ip address
discovery.zen.minimum_master_nodes: 2

```

_The first two lines are important for nodes inside Docker containers to communicate with each other and are less important for Zen Discovery I guess._

Without configuring `transport.tcp.port` and `discovery.zen.ping.unicast.hosts` the nodes fail to start.

This is how I start the containers:  
`docker run --name master1 -p 9300:9300 <elasticsearch_image>`  
`docker run --name master2 -p 9301:9301 <elasticsearch_image>`

This what I got:

```auto
[2019-01-29T14:40:15,370][WARN][o.e.d.z.ZenDiscovery] [master1]
not enough master nodes discovered during pinging
(found [[Candidate{node={master1}{fLG4b6OESXqlRPZMlU8Jyg}
{nBpqu7D9SzSme3-nD4JX3A}{10.50.15.26}{10.50.15.26:9300}
{ml.machine_memory=16694579200, xpack.installed=true, ml.max_open_jobs=20,
ml.enabled=true}, clusterStateVersion=-1}]], but needed [2]), pinging again

```

It seems as if _master1_ found itself and stopped looking for other nodes. Same for _master2_.

Now I do some configuration like this:  
_master1_:

```auto
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: 10.50.15.26:9301

```

_master2_:

```auto
transport.tcp.port: 9301
discovery.zen.ping.unicast.hosts: 10.50.15.26:9300

```

With this config everything runs fine.

–––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

While it can be reasonable to stick with this configuration for the master-only nodes (as they tend to stay in threes) it only shifts the problem.  
Let's say I want to a bunch of data nodes or coordinating-only nodes. The configuration looks like this:

```auto
network.bind_host: 0.0.0.0
network.publish_host: 10.50.15.26
http.port: 9210-9219
transport.tcp.port: 9310-9319
discovery.zen:
  minimum_master_nodes: 2
  ping.unicast.hosts:
    - 10.50.15.26:9300 <– master1
    - 10.50.15.26:9301 <– master2
    - 10.50.15.26:9302 <– master3

```

Start them:  
`docker run --name data1 -p 9210:9210 -p 9310:9310 <elasticsearch_image>`  
`docker run --name data2 -p 9211:9211 -p 9311:9311 <elasticsearch_image>`  
`...`  
The first one successfully joins the cluster! The second gives this error:

```auto
[2019-01-29T14:46:29,157][INFO][o.e.d.z.ZenDiscovery] [data2]
failed to send join request to master [{master2}{1bhY71VgS_6WIhg1Xu6ZIw}
{NyojrkngTDamazzfeDfHjg}{10.50.15.26}{10.50.15.26:9301}
{ml.machine_memory=16694579200, ml.max_open_jobs=20,
xpack.installed=true, ml.enabled=true}], reason [RemoteTransportException
[[master2][172.24.0.4:9301][internal:discovery/zen/join]]; nested:
ConnectTransportException[[gateway_59d729b0ac1b][10.50.15.26:9310]
handshake failed. unexpected remote node {data1}
{2wlGWuROTRGQ271YgCzQbQ}{t5UWdlbGTu67-Y42QSDJXA}
{10.50.15.26}{10.50.15.26:9310}{ml.machine_memory=16694579200,
ml.max_open_jobs=20, xpack.installed=true, ml.enabled=true}]; ]

```

New it seems that _data2_ collides with _data1_ in some way.  
Can somebody help me out?  
It is – again – absolutely possible that there is a major lack in my understanding of this zen communication. Please explain then.

Thank you!

---

<div class="post-metadata">

### Author: ![darefilz](https://avatars.discourse-cdn.com/v4/letter/d/d07c76/32.png) [@darefilz](https://discuss.elastic.co/u/darefilz)
#### Post date: [February 1, 2019, 10:28am UTC](https://discuss.elastic.co/t/zen-discovery-and-the-transport-ports/166194/2 "2019-02-01T10:28:18Z")

</div>

Hi again,

it is probably unclear, what I want to achieve.  
I try to say it in a few sentences:

1. We want to scale dockerized Elasticsearch nodes horizontally.
2. Potentially, multiple nodes can live on the same host.
3. There has to be a configuration so that they automatically use a port between 93xx and 93yy without conflicting with other instances on the same host.
4. They eventually need to discover the cluster.

Please help me finding this configuration.  
Regards

---

<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: [March 1, 2019, 10:28am UTC](https://discuss.elastic.co/t/zen-discovery-and-the-transport-ports/166194/3 "2019-03-01T10:28:21Z")

</div>

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