# Data node can't find the master on elasticsearch cluster

**URL:** https://discuss.elastic.co/t/data-node-cant-find-the-master-on-elasticsearch-cluster/254043
**Category:** Elasticsearch
**Created:** [November 2, 2020, 2:28pm UTC](https://discuss.elastic.co/t/data-node-cant-find-the-master-on-elasticsearch-cluster/254043 "2020-11-02T14:28:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Pavle\_Ilic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavle_ilic/32/78275_2.png) [@Pavle\_Ilic](https://discuss.elastic.co/u/Pavle_Ilic)
#### Post date: [November 2, 2020, 2:28pm UTC](https://discuss.elastic.co/t/data-node-cant-find-the-master-on-elasticsearch-cluster/254043/1 "2020-11-02T14:28:41Z")

</div>

So, I have two elasticsearch servers and wanted to form a cluster with master and data node, but I'm facing some difficulties in connecting them in a same cluster, these are my .yml files and the things I've tried so far, any help would be appreciated:

xxx.235 yml: #data node

```auto
cluster.name: monitoring
node.name: "es-data-node-2"
node.master: false
node.data: true

path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

network.host: xxx.235
network.publish_host: xxx.52
http.port: 9200

discovery.seed_hosts: ["xxx.52", "xxx.235"] #tried this instead as well discovery.zen.ping.unicast.hosts: 2
discovery.zen.minimum_master_nodes: 2 #tried with 1 also
cluster.initial_master_nodes: ["xxx.52"]

```

xxx.52 yml: #master node

```auto
cluster.name: monitoring
node.name: "es-master"
node.master: true
node.data: false

path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch

network.host: xxx.52
http.port: 9200

discovery.seed_hosts: ["xxx.52", "xxx.235"] #tried this instead as well discovery.zen.ping.unicast.hosts: 2
discovery.zen.minimum_master_nodes: 2 #tried with 1 also
cluster.initial_master_nodes: ["xxx.52"]

```

Things I tried but didn't help:  
Enabling 9200 and 9300 ports and testing them via telnet and connection is good and ports are open.  
Adding the line publish\_host on both servers.  
Switching between seed\_hosts and zen.ping.unicast.hosts.

Until I added the line  
node.master: false  
on the data node, it just got up but didn't connect to the right cluster.  
And now i'm getting 503 error, master\_not\_discovered\_exception, reason: null on the data node.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [November 2, 2020, 6:08pm UTC](https://discuss.elastic.co/t/data-node-cant-find-the-master-on-elasticsearch-cluster/254043/2 "2020-11-02T18:08:22Z")

</div>

It sounds like -- at some point in the past -- you allowed these nodes to form independent clusters. You [cannot merge clusters together](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#modules-discovery-bootstrap-cluster-joining). The simplest fix is to wipe the data path on the data node, which will reset everything and allow it to join the master node.

Note also `discovery.zen.minimum_master_nodes` is deprecated and ignored in 7.x, and `cluster.initial_master_nodes` should be removed now that the cluster has formed (and should have been the `node.name` not the IP address).

---

<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: [November 30, 2020, 6:08pm UTC](https://discuss.elastic.co/t/data-node-cant-find-the-master-on-elasticsearch-cluster/254043/3 "2020-11-30T18:08:24Z")

</div>

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