# Master election process is not happening

**URL:** https://discuss.elastic.co/t/master-election-process-is-not-happening/229443
**Category:** Elasticsearch
**Created:** [April 23, 2020, 10:52am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443 "2020-04-23T10:52:53Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)
#### Post date: [April 23, 2020, 10:52am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/1 "2020-04-23T10:52:53Z")

</div>

HI,  
I have configured multi master node configurtaion in cluster but master election process is not happening correctly ..

I have 4 nodes out of 4 , Node1, Node2 and node3 is master node and node 4 is data node.  
Active master node is Node 1. i have configured yml file like below

```auto
discovery.seed_hosts: ["Node1", "Node2","Node3","Node4"]

cluster.initial_master_nodes: ["Node1","Node2","Node3"]

```

After cluster configuration everything is running but when i stopped node1 then node2 is not taking as master .  
Is there any configuration i missed here could you please help me out.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 23, 2020, 11:05am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/2 "2020-04-23T11:05:17Z")

</div>

> [@abhishek1](#):
>
> ```auto
> discovery.seed_hosts: ["Node1", "Node2","Node3","Node4"]
> 
> ```

You only need to mention the master-eligible nodes in `discovery.seed_hosts`, so `"Node4"` shouldn't be there.

> [@abhishek1](#):
>
> ```auto
> cluster.initial_master_nodes: ["Node1","Node2","Node3"]
> 
> ```

This setting is ignored once the cluster is running, and should be removed.

Without logs it's not really possible to help further. What do the logs say?

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [April 23, 2020, 11:16am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/3 "2020-04-23T11:16:05Z")

</div>

If you have 3 master eligible nodes you always need 2 available to elect a master. You can therefore not shut down 2 and expect a master to be elected.

---

<div class="post-metadata">

### Author: ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)
#### Post date: [April 23, 2020, 11:16am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/4 "2020-04-23T11:16:09Z")

</div>

> [@DavidTurner](#):
>
> You only need to mention the master-eligible nodes in `discovery.seed_hosts` , so `"Node4"` shouldn't be there.

If it is so then where i need to mention for data node. Could you please tell me

---

<div class="post-metadata">

### Author: ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)
#### Post date: [April 23, 2020, 11:20am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/5 "2020-04-23T11:20:43Z")

</div>

Yes, here what i have configured is like

```auto
Node1
node.master: true
node.data:false
 
Node2
node.master: true
node.data:false

Node3
node.master: true
node.data:false

```

Configuration is correct ??

---

<div class="post-metadata">

### Author: ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)
#### Post date: [April 23, 2020, 11:23am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/6 "2020-04-23T11:23:15Z")

</div>

because i need to add one more node as data node in this cluster

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 23, 2020, 11:26am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/7 "2020-04-23T11:26:39Z")

</div>

> [@abhishek1](#):
>
> If it is so then where i need to mention for data node. Could you please tell me

You don't. You tell the data node how to discover the master, not the other way around.

---

<div class="post-metadata">

### Author: ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)
#### Post date: [April 23, 2020, 11:30am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/8 "2020-04-23T11:30:23Z")

</div>

> [@DavidTurner](#):
>
> You don't. You tell the data node how to discover the master, not the other way around.

ok but how to do that could you please help me to configure data node with this master .  
I need to add that data node also in this cluster right ..

so in data node how can i configure with discovery.host....

---

<div class="post-metadata">

### Author: ![abhishek1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@abhishek1](https://discuss.elastic.co/u/abhishek1)
#### Post date: [April 23, 2020, 11:33am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/9 "2020-04-23T11:33:14Z")

</div>

> [@DavidTurner](#):
>
> > [@DavidTurner](#):
> >
> > You don't. You tell the data node how to discover the master, not the other way around.
> 
> ok but how to do that could you please help me to configure data node with this master .  
> I need to add that data node also in this cluster right ..
> 
> so in data node how can i configure with discovery.host....

As of now i have three master node is running like below

```auto
 "cluster_name" : "test",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 0,
  "active_primary_shards" : 0,
  "active_shards" : 0,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0

```

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [May 21, 2020, 11:33am UTC](https://discuss.elastic.co/t/master-election-process-is-not-happening/229443/10 "2020-05-21T11:33:17Z")

</div>

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