# Create configuration with minimum 2 master nodes

**URL:** <https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [May 20, 2021, 9:40am UTC](https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501 "2021-05-20T09:40:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkaramol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkaramol/32/22610_2.png) [@pkaramol](https://discuss.elastic.co/u/pkaramol)\
**Post date:** [May 20, 2021, 9:40am UTC](https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501/1 "2021-05-20T09:40:51Z")

</div>

I want (via ECK) to create a setup where

a) there will be three nodes in total having all roles

b) there will be a MINIMUM of 2 master nodes

Is the following configuration on the `Elasticsearch` resource legit?

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elasticsearch-sample
  namespace: eck-poc
spec:
  version: 7.11.0
  nodeSets:
  - name: multirolenodes
    config:
      node.roles: ["master","ingest","data","remote_cluster_client","ml"]
      node.store.allow_mmap: false
      discovery.zen.minimum_master_nodes: 2

```

if not, what is the way to go about it and how can I then later validate that I indeed get (at least) 2 master nodes?

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [May 20, 2021, 10:35am UTC](https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501/2 "2021-05-20T10:35:38Z")

</div>

Your configuration example is not what you want. `discovery.zen.minimum_master_nodes` is a setting that is deprecated/without effect in Elasticsearch 7.x

The second thing is that from an architecture point of view 2 master nodes is not a recommended setup as it gives no benefit over a single master node (quorum is n/2 + 1 = 2 ). I think you want 3 master nodes if you want additional resilience against (temporary) node failures.

In ECK you need to specify the `count` attribute to get any nodes at all, your current configuration would fail validation or in the absence of a validating webhook just not spin up any nodes.

Finally regarding the node roles: you do not need to specify the roles explicitly if you want a mixed role setup. By default each node has all roles already.

So I would suggest something like:

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elasticsearch-sample
  namespace: eck-poc
spec:
  version: 7.11.0
  nodeSets:
  - name: multirolenodes
    count: 3
    config:
      # node.store.allow_mmap: false you only need this if your hosts are not configured correctly see https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-virtual-memory.html

```

---

<div class="post-metadata">

**Author:** ![pkaramol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pkaramol/32/22610_2.png) [@pkaramol](https://discuss.elastic.co/u/pkaramol)\
**Post date:** [May 20, 2021, 10:40am UTC](https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501/3 "2021-05-20T10:40:50Z")

</div>

Thanks @pebrc , yes I had the `spec.count` in the truncated part of my mainfest.

---

<div class="post-metadata">

**Author:** ![pebrc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pebrc/32/101790_2.png) [@pebrc](https://discuss.elastic.co/u/pebrc)\
**Post date:** [May 20, 2021, 10:51am UTC](https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501/4 "2021-05-20T10:51:48Z")

</div>

> [@pkaramol](#):
>
> Thanks @pebrc , yes I had the `spec.count` in the truncated part of my mainfest.

Ah ok, sorry, wasn't sure if there was something missing. 👍

---

<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:** [June 17, 2021, 10:52am UTC](https://discuss.elastic.co/t/create-configuration-with-minimum-2-master-nodes/273501/5 "2021-06-17T10:52:12Z")

</div>

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