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
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.