Data node can't find the master on elasticsearch cluster

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

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

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.

It sounds like -- at some point in the past -- you allowed these nodes to form independent clusters. You cannot merge clusters together. 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).

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