# How to determine number of master nodes

**URL:** https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780
**Category:** Elasticsearch
**Created:** [July 16, 2022, 10:24am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780 "2022-07-16T10:24:43Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![wisam\_9mol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wisam_9mol/32/108389_2.png) [@wisam\_9mol](https://discuss.elastic.co/u/wisam_9mol)
#### Post date: [July 16, 2022, 10:24am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/1 "2022-07-16T10:24:44Z")

</div>

Is there a way to find out how many master nodes I need for a number of data nodes For example If I have 100 data nodes, how many masters nodes do I need? In the case of 12 data nodes Or 18 data nodes

---

<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: [July 16, 2022, 10:31am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/2 "2022-07-16T10:31:04Z")

</div>

The answer is usually 3, and does not scale with data node count. Only one of the master nodes is active at any point and the others are there for resilience. The only reason you would go over 3 is if you require to be able to withstand more than one master node failing at any time. If you e.g. deploy a cluster across 5 distinct availability zones you may want 5 dedicated master nodes so you can handle losing 2 of them without affecting the cluster (a strict majority of master eligible nodes always need to be available for the cluster to function properly).

---

<div class="post-metadata">

### Author: ![wisam\_9mol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wisam_9mol/32/108389_2.png) [@wisam\_9mol](https://discuss.elastic.co/u/wisam_9mol)
#### Post date: [July 16, 2022, 10:35am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/3 "2022-07-16T10:35:00Z")

</div>

Thanks  
I have a simple question  
We know that one of the master node functions is to create and delete indexes  
Suppose I have 160 data nodes  
Will 3 master nodes be enough for 160 data nodes?  
Thank you for your help

---

<div class="post-metadata">

### Author: ![wisam\_9mol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wisam_9mol/32/108389_2.png) [@wisam\_9mol](https://discuss.elastic.co/u/wisam_9mol)
#### Post date: [July 16, 2022, 10:39am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/4 "2022-07-16T10:39:32Z")

</div>

I mean, is there a relationship between the number of data node and master node

---

<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: [July 16, 2022, 10:40am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/5 "2022-07-16T10:40:18Z")

</div>

> [@wisam\_9mol](#):
>
> I mean, is there a relationship between the number of data node and master node

No, there is not.

---

<div class="post-metadata">

### Author: ![wisam\_9mol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wisam_9mol/32/108389_2.png) [@wisam\_9mol](https://discuss.elastic.co/u/wisam_9mol)
#### Post date: [July 16, 2022, 10:44am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/6 "2022-07-16T10:44:13Z")

</div>

Thank you very much

---

<div class="post-metadata">

### Author: ![wisam\_9mol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wisam_9mol/32/108389_2.png) [@wisam\_9mol](https://discuss.elastic.co/u/wisam_9mol)
#### Post date: [July 16, 2022, 10:51am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/7 "2022-07-16T10:51:28Z")

</div>

I have one last question  
How many Ingest nodes and Client nodes do I need for n number of data knots  
Does the number of data node relate to the number of Client nodes and Ingest nodes?

---

<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: [July 16, 2022, 10:53am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/8 "2022-07-16T10:53:47Z")

</div>

> [@wisam\_9mol](#):
>
> How many Ingest nodes and Client nodes do I need for n number of data knots  
> Does the number of data node relate to the number of nodes and nodes?

That depends on the data and workload. It is something you will need to test and find out.

---

<div class="post-metadata">

### Author: ![wisam\_9mol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wisam_9mol/32/108389_2.png) [@wisam\_9mol](https://discuss.elastic.co/u/wisam_9mol)
#### Post date: [July 16, 2022, 10:55am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/9 "2022-07-16T10:55:09Z")

</div>

Are there reference sources for that?

---

<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: [July 16, 2022, 11:00am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/10 "2022-07-16T11:00:55Z")

</div>

Have a look at [this blog post](https://www.elastic.co/blog/benchmarking-and-sizing-your-elasticsearch-cluster-for-logs-and-metrics). The number of data nodes depends on daily ingest volume as well as the retention period. I would expect the number of ingest nodes required to be proportional to the ingested voilume per day and also depend on the complexity of your pipeline(s). This can vary a lot so you need to test to see how it applies to your use case.

---

<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: [July 17, 2022, 9:37am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/11 "2022-07-17T09:37:58Z")

</div>

> [@Christian\_Dahlqvist](#):
>
> The answer is usually 3, and does not scale with data node count.

For future reference, this is covered [here in the reference manual](https://www.elastic.co/guide/en/elasticsearch/reference/current/high-availability-cluster-small-clusters.html#high-availability-cluster-design-three-plus-nodes):

> However, it is good practice to limit the number of master-eligible nodes in the cluster to three. Master nodes do not scale like other node types since the cluster always elects just one of them as the master of the cluster. If there are too many master-eligible nodes then master elections may take a longer time to complete.

Note also [this sizing guidance](https://www.elastic.co/guide/en/elasticsearch/reference/current/size-your-shards.html#shard-count-recommendation):

> Aim for 3000 indices or fewer per GB of heap memory on each master node

* * *

> [@Christian\_Dahlqvist](#):
>
> you may want 5 dedicated master nodes so you can handle losing 2 of them without affecting the cluster

This is not quite true, at least not without significant extra complexity in the orchestration system that surrounds Elasticsearch. By default with 5 masters there are some sequences of events that require 4 of those masters to be active. See [these docs](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-voting.html):

> **NOTE** : If `cluster.auto_shrink_voting_configuration` is set to `true` (which is the default and recommended value) and there are at least three master-eligible nodes in the cluster, Elasticsearch remains capable of processing cluster state updates as long as all but one of its master-eligible nodes are healthy.
> 
> There are situations in which Elasticsearch might tolerate the loss of multiple nodes, but this is not guaranteed under all sequences of failures. If the `cluster.auto_shrink_voting_configuration` setting is `false`, you must remove departed nodes from the voting configuration manually. Use the [voting exclusions API](https://www.elastic.co/guide/en/elasticsearch/reference/current/voting-config-exclusions.html) to achieve the desired level of resilience.

TLDR we recommend three master-eligible nodes in all circumstances.

---

<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: [August 14, 2022, 9:38am UTC](https://discuss.elastic.co/t/how-to-determine-number-of-master-nodes/309780/12 "2022-08-14T09:38:14Z")

</div>

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