Upgrading 6.0.1 to 6.0.6 problem. No primary detected

Hello. I am trying to upgrade my Ubuntu OS from 18.04 to 20.04. In this case the mongodb packages will also be updated to its latest version which is 6.0.4

Here is my setup

10.1.0.11:27017 - Primary
10.1.0.12:27017 - Secondary
10.1.0.12:27018 - Arbiter

I first upgrade my Primary VM and the replica set is running successfully. However, when I try to proceed for the Secondary VM (which involves shutting down mongodb and server itself) which also contains the arbiter.

Is there something wrong on my steps? Should I do the Secondary first? Or in my setup there should at least be 2 members running for this to work? This is dev environment. In our production, the arbiter is in another VM outside Primary and Secondary VM.

If you read carefully about replication you will find the answer to

And the answer is yes. If you shut down any instance in you replica set, there will be an election. For an election to select a PRIMARY, you need a majority of voting nodes. With

you end up with only 1 node, hence no majority, hence no PRIMARY.

As a quick fix, you may set up an arbiter on the primary VM, remove the arbiter of the 2nd VM from the replica set, update the secondary, then move back the arbitern from the 1st VM to the 2nd VM.

Arbiters are not really recommended for production.

2 Likes

Instead of having an arbiter to achieve a 3 node setup, what do you recommend though? Having 1 Primary then 2 Secondary Nodes?

Yes P-S-S is a valid setup and all 3 nodes should be in different data centers

2 Likes