So, I have two elasticsearch servers (version 7 of elasticsearch) 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, both nodes we're on their own separate clusters
network.publish_host
in your data node to the IP of your master node? Does your data node machine have another IP that ends in.52
? Also, if those IPs are not public, you can share them in your question without problem. – leandrojmp