# Can you set replsets to less than 3

**URL:** https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532
**Category:** Percona Operator for MongoDB
**Created:** [April 20, 2023, 1:13pm UTC](https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532 "2023-04-20T13:13:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)
#### Post date: [April 20, 2023, 1:13pm UTC](https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532/1 "2023-04-20T13:13:20Z")

</div>

Hi,

We are attemtping to deploy mongodb on a aws eks cluster using this operator.

I noticed that even if i modify the params it will always create at minimum 3 replicasets.

**psmdb-db.values.yaml**

```auto
replsets:
  - name: rs0
    size: 1

```

is it possible to have size 1?

* * *

When setting it to 1 it seems to always create 4 (0-3)

```auto
 kubectl get pods -n mongodb khan: Thu Apr 20 14:18:02 2023

NAME READY STATUS RESTARTS AGE
psmdb-db-rs0-0 2/2 Running 0 100s
psmdb-db-rs0-1 2/2 Running 0 75s
psmdb-db-rs0-2 2/2 Running 0 55s
psmdb-db-rs0-3 2/2 Running 0 37s
psmdb-db-rs0-arbiter-0 1/1 Running 0 100s
psmdb-operator-584fc857f8-s2f4t 1/1 Running 0 69m

```

---

<div class="post-metadata">

### Author: ![Tomislav\_Plavcic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tomislav_plavcic/32/9717_2.png) [@Tomislav\_Plavcic](https://forums.percona.com/u/Tomislav_Plavcic)
#### Post date: [April 20, 2023, 1:26pm UTC](https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532/2 "2023-04-20T13:26:18Z")

</div>

Hi @Kay_Khan !

If you want to set less than 3 you will have to specify `allowUnsafeConfigurations: true` option.  
You can check the description of the option on this page: [Custom Resource options - Percona Operator for MongoDB](https://docs.percona.com/percona-operator-for-mongodb/operator.html)

---

<div class="post-metadata">

### Author: ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)
#### Post date: [April 20, 2023, 1:28pm UTC](https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532/3 "2023-04-20T13:28:44Z")

</div>

> [@Tomislav\_Plavcic](#):
>
> allowUnsafeConfigurations

thank you! much appreciated

---

<div class="post-metadata">

### Author: ![Kay\_Khan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kay_khan/32/17023_2.png) [@Kay\_Khan](https://forums.percona.com/u/Kay_Khan)
#### Post date: [April 20, 2023, 1:39pm UTC](https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532/4 "2023-04-20T13:39:19Z")

</div>

Just a follow up as i think its related, after spinning up a single replica. I can see in the logs of the pod that i get the following error:

**kubectl logs -f psmdb-db-rs0-0 -n mongodb**

> {“t”:{“$date”:“2023-04-20T13:34:46.606+00:00”},“s”:“E”, “c”:“REPL”, “id”:21420, “ctx”:“conn644”,“msg”:“replSetReconfig error while validating new config”,“attr”:{“error”:{“code”:2,“codeName”:“BadValue”,“errmsg”:“Replica set configuration must contain at least one non-arbiter member with priority \> 0”},“newConfig”:{“\_id”:“rs0”,“version”:16,“term”:5,“members”:[{“\_id”:0,“host”:“psmdb-db-rs0-0.psmdb-db-rs0.mongodb.svc.cluster.local:27017”,“arbiterOnly”:false,“buildIndexes”:true,“hidden”:false,“priority”:0,“tags”:{“podName”:“psmdb-db-rs0-0”,“serviceName”:“psmdb-db”},“secondaryDelaySecs”:0,“votes”:0},{“\_id”:4,“host”:“psmdb-db-rs0-arbiter-0.psmdb-db-rs0.mongodb.svc.cluster.local:27017”,“arbiterOnly”:true,“buildIndexes”:true,“hidden”:false,“priority”:0,“tags”:{},“secondaryDelaySecs”:0,“votes”:1}],“protocolVersion”:1,“writeConcernMajorityJournalDefault”:true,“settings”:{“chainingAllowed”:true,“heartbeatIntervalMillis”:2000,“heartbeatTimeoutSecs”:10,“electionTimeoutMillis”:10000,“catchUpTimeoutMillis”:-1,“catchUpTakeoverDelayMillis”:30000,“getLastErrorModes”:{},“getLastErrorDefaults”:{“w”:1,“wtimeout”:0},“replicaSetId”:{“$oid”:“644131f88edfa9769a039f56”}}},“oldConfig”:{“\_id”:“rs0”,“version”:15,“term”:5,“members”:[{“\_id”:0,“host”:“psmdb-db-rs0-0.psmdb-db-rs0.mongodb.svc.cluster.local:27017”,“arbiterOnly”:false,“buildIndexes”:true,“hidden”:false,“priority”:2,“tags”:{“serviceName”:“psmdb-db”,“podName”:“psmdb-db-rs0-0”},“secondaryDelaySecs”:0,“votes”:1},{“\_id”:4,“host”:“psmdb-db-rs0-arbiter-0.psmdb-db-rs0.mongodb.svc.cluster.local:27017”,“arbiterOnly”:true,“buildIndexes”:true,“hidden”:false,“priority”:0,“tags”:{},“secondaryDelaySecs”:0,“votes”:1}],“protocolVersion”:1,“writeConcernMajorityJournalDefault”:true,“settings”:{“chainingAllowed”:true,“heartbeatIntervalMillis”:2000,“heartbeatTimeoutSecs”:10,“electionTimeoutMillis”:10000,“catchUpTimeoutMillis”:-1,“catchUpTakeoverDelayMillis”:30000,“getLastErrorModes”:{},“getLastErrorDefaults”:{“w”:1,“wtimeout”:0},“replicaSetId”:{“$oid”:“644131f88edfa9769a039f56”}}}}}

```auto
kubectl get pods -n mongodb                 
NAME READY STATUS RESTARTS AGE
psmdb-db-rs0-0 2/2 Running 0 8m48s
psmdb-db-rs0-arbiter-0 1/1 Running 0 8m48s
psmdb-operator-584fc857f8-s2f4t 1/1 Running 0 88m

```

Is this suggesting that i need to change/set the `priority` of this single node?

---

<div class="post-metadata">

### Author: ![Tomislav\_Plavcic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tomislav_plavcic/32/9717_2.png) [@Tomislav\_Plavcic](https://forums.percona.com/u/Tomislav_Plavcic)
#### Post date: [April 20, 2023, 2:46pm UTC](https://forums.percona.com/t/can-you-set-replsets-to-less-than-3/21532/5 "2023-04-20T14:46:09Z")

</div>

Can you please try to disable arbiter since for 1 node I don’t see the purpose and it is possibly making a problem. Arbiter is usually used in a setup like 2 data nodes + 1 arbiter or 4 data nodes + 1 arbiter to save resources but still be able to have normal elections and prevent network split.
