ES 2 master node configuration

Hi Team,

There are 2 master eligible nodes with below configuration. Node 1 (only master) , Node2(master and data and belonging to one of the data center) , in addition there are 4 more only data nodes belonging to one of the data center

node1
cluster.name: elkprod.com
node.name: node1
node.master: true
node.voting_only: false
node.data: false
network.host: 10.04.007.14
http.port: 61049
cluster.routing.allocation.awareness.attributes: rack
cluster.routing.allocation.awareness.force.rack.values: reigate,stalbans
discovery.seed_hosts: ["10.04.007.14", "10.03.009.184"]
cluster.initial_master_nodes: ["node2","node1"]
transport.port: 61100-61300

node2
cluster.name: elkprod.com
node.name: node2
node.master: true
node.voting_only: false
node.data: true
network.host: 10.03.009.184
http.port: 61049
node.attr.rack: stalbans
cluster.routing.allocation.awareness.attributes: rack
cluster.routing.allocation.awareness.force.rack.values: reigate,stalbans
discovery.seed_hosts: ["10.04.007.14", "10.03.009.184"]
cluster.initial_master_nodes: ["node2","node1"]
transport.port: 61100-61300

only node1 is acting as master node, even if I bring node1 down, node2 is not elected as master node.

Am I missing something in configuration. Please help. Thanks.

Regards,
Tushar Khanna

Master election requires a strict majority of master eligible nodes to agree a new master. With only 2 master eligible nodes in the cluster both therefore have to be available. You should always have at least 3 master eligible nodes in a cluster if you want to be able to have a green cluster even if one node goes down.

2 Likes

It worked after I made 3 nodes as master-eligible. Thanks for your help.