Elasticsearch 7.13 2 nodes cluster

Hi
I have two nodes(xnode1, xnode2) cluster on elasticsearch 7.13. I made cluster succesfully, it showing 2 nodes in cluster.
For testing i stop xnode2, it showing 1 node cluster. but when stop xnode1 , then try curl with xnode2 it showing : master_not_discovered_exception.

When i stooping 2nd node xnode2 getting

[2021-06-15T07:10:31,830][WARN ][o.e.c.c.ClusterFormationFailureHelper] [xnode1] master not discovered or elected yet, an election requires a node with id [D4NWZ2baTf2hdUF6VgZ65A], have discovered [{xnode2}{Q8_O0deGQomb2mGM5KN4Ew}{3cAb9kpeS1SpCGOlN17MFQ}{192.168.10.2}{192.168.10.2:9300}{cdfhilmrstw}] which is not a quorum; discovery will continue using [192.168.10.1:9300] from hosts providers and [{vodaxsimnode1}{D4NWZ2baTf2hdUF6VgZ65A}{JdGeacDuT6Cvcl0poLgDJQ}{192.168.10.1}{192.168.10.1:9300}{cdfhilmrstw}, {xnode2}{Q8_O0deGQomb2mGM5KN4Ew}{3cAb9kpeS1SpCGOlN17MFQ}{192.168.10.22}{192.168.10.2:9300}{cdfhilmrstw}] from last-known cluster state; node term 3, last-accepted version 49 in term 3
 
 Please help me, i want make cluster with two nodes. Thanks
 
 Configuration on xnode1 :
 
 cluster.name: mucluster
 node.name: xnode1
 #network.host: 0.0.0.0
 network.host: 192.168.10.1
 http.port: 8207
 
discovery.seed_hosts : ["192.168.10.1","192.168.10.2"]
 
cluster.initial_master_nodes: ["192.168.10.1","192.168.10.2"]
#cluster.initial_master_nodes: ["xnode1","xnode2"]
 
 
 
 Configuration on xnode2 :
  
 cluster.name: mucluster
 node.name: xnode2
 #network.host: 0.0.0.0
 network.host: 192.168.10.2
 http.port: 8207
 
discovery.seed_hosts : ["192.168.10.1","192.168.10.2"]
 
cluster.initial_master_nodes: ["192.168.10.1","192.168.10.2"]
#cluster.initial_master_nodes: ["xnode1","xnode2"]

This older post provides more details.

Also, this part of docs may also be of benefit to understand the situation when you are down to 2 master-eligible nodes and one is removed.

A 2 node cluster can not be highly available and continue operating fully if one node goes down. Please read this section in the docs for further details.

But cluster made success and when i stop 2nd node, then cluster showing 1 node. but when i stop 1st node then , then there is no master, means in my case only first node becoming master.
in previous version i did that. please help if i have two nodes

what will my configuration for 3rd node, if going to add

In order to elect a master a strict majority of master eligible nodes need to be available. The majority of 2 is 2 which means a 2-node cluster can not elect a master as soon as one node is down. If you add a third node with the same main configuration you have 3 master eligible nodes in the cluster. The majority of 3 is 2 which means that even if 1 node goes offline the remaining 2 can elect a master and continue operating safely.

okay, but i my case only first node become master, even i stopped 2nd node first working.
[If 2nd node stopped then in cluster showing 1 node] , but when stooping 1st one this one become issue, why i can not make 2nd node master, already given in configuration.

I am not sure I understand. It doesn't matter which node is elected master when both nodes are available.

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