I am new to Elasticsearch and I want to set up a highly available Elasticsearch cluster on one machine to test and learn how to use Elasticsearch. I hope that when the master node fails, one of the other nodes will take over and become the master node. On my machine, I set up an Elasticsearch cluster consisting of 3 nodes, a master node and two data nodes, but when I stopped the master node, none of the other nodes took over and became the master node, here is my config for the three nodes (used version of elasticsearch is 7.9.2):
# master node config.
cluster.name:demo-cluster
node.name: "es-node-1"
node.master: true
node.data: false
discovery.zen.minimum_master_nodes: 2
# data node 1 config.
cluster.name:demo-cluster
node.name: "es-node-2"
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 2
# data node 2 config.
cluster.name:demo-cluster
node.name: "es-node-3"
node.master: false
node.data: true
discovery.zen.minimum_master_nodes: 2
Does anyone have an idea please?