0

I have a replica set of three server and a backup server, The backup server is made

"hidden"=true and "priority"=0`

My concern is when I have one of my secondary and backup server up, my secondary does not changes into primary, which means hidden server is not taking part in election, but as per the mongo document, it cannot become primary but takes part in election. Is their some extra configuration required to do so?

Phalguni Mukherjee
  • 623
  • 3
  • 11
  • 29

1 Answers1

2

Replica set member cannot become primary if is unable to connect to a majority of replica set members. If you have four members in a replica set you need to be be able to communicate with three and if only two members are up it is clearly impossible. If you really want configuration like this you should add arbiter to the replica set.

Generally speaking you should avoid even number of members in the replica set.

zero323
  • 322,348
  • 103
  • 959
  • 935
  • @zeroes one of my server is a backup server with priority 0, so will it not take part in the election? If the answer is no is their a way I can get a combination of both arbitrary and backup? – Phalguni Mukherjee Nov 18 '13 at 12:36
  • It takes part in the election but 2 out of 4 is not a majority. You need 3 out of 4 to elect new primary. You can add another member of the rs with `arbiterOnly: true` option. It won't store the data but it will participate in the elections and will give you a chance to achieve majority when 2 nodes are down. BTW It is hard to say what you mean when sat "backup". Every non arbiter in the rs serves as backup. Generally hidden members can be used for heavy BI tasks or for rollbacks (with `slaveDelay`). – zero323 Nov 18 '13 at 13:06
  • 1
    If you use hidden member only as a backup you could use [MMS Backup service](https://mms.mongodb.com/learn-more#backup) instead. – zero323 Nov 18 '13 at 13:26