Not able to create a cluster in Elasticsearch

I have configured two nodes to create a cluster. Both these nodes are working fine separately. When We join them together to form a cluster, Only single node is appearing in cluster.
The elasticsearch.yml of both node is mentioned below:

========Node-1======================
cluster.name: "docker-cluster"
network.host: 0.0.0.0
http.port: 9200
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.unicast.hosts: ["NODE1-IP","NODE2-IP"]

===============Node-2==============

cluster.name: "docker-cluster"
network.host: 0.0.0.0
http.port: 9200
node.master: true
node.data: true
discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.unicast.hosts: ["NODE1-IP","NODE2-IP"]

My Requirement is to create a cluster of two nodes and if node1(Master node) fails anyhow, node2 automatically starts working as a Master node.
I have searched a lot but can't find anything wrong in my configuration.

Please help!!!

Hi,

when you say:

When We join them together to form a cluster, Only single node is appearing in cluster.

How do you know that they join if you still have one node?

Did you check in the logs you are suppose to have some comment about the node discover the other one and they join. If you have nothing in the logs it mean that your 2 nodes can't communicate, depend on your environment you may need to install plugin to make it work, you also need to open the port (default 9300) to make them communicate....

Let's go step by step first check your logs, and can you confirm that your nodes can communicate?

Also just a notice but with only 2 servers you have a risk of split brain check in the forum there's a lot of topics about.

https://discuss.elastic.co/search?q=split%20brain%20category%3A6

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