Upgrade Mongo ver and machine OS

Hello community,

in my company we have a Replica Set Cluster, with 3 members, using Mongo 4.0.28 and based on Centos 7.

We would like to upgrade our systems/softwares, porting the machines from Centos 7 to Ubuntu 20, and mongo from 4.0.28 to 4.4 (passing by 4.2).

Is any of this two scenarios i thought of vaiable?

Case 1:

3 members with centos 7 and mongo 4.0.28
update whole cluster to mongo 4.4, then add a new member with ubuntu 20 and mongo 4.4 and as last remove one member with centos 7
repeat for the other 2 members of the cluster

Case 2:

3 members with centos 7 and mongo 4.0.28
stay with the cluster as mongo 4.0.28, then add a new member with ubuntu 20 and mongo 4.4 and as last remove one member with centos 7
repeat for the other 2 members of the cluster

If you have any different suggestion i’m all ears.

Thanks!

First if you are going to upgrade you can’t skip a major version you must upgrade them in order so for example. 4.0 → 4.2 → 4.4 this is outlined in the MongoDB documentation.

Are you trying to do this with 0 downtime or is it acceptable? Also it’s helpful to know how much data is in your clusters because that will affect your options.

1 Like

Thank you for fast answer.
Yes, I scheduled update to 4.2 first :slight_smile:

If it’s possibile I’d prefer no downtime

Each node of replicaset host about 500 GB of data

Hi @jack_c,
if you want to take a little bit of a risk, you could install a replica set with alredy the version 4.4 and migrate directly data from 4.0 (centos) to the 4.4 (ubuntu).
DISCLAIMER: is not 100 percent guaranteed to work, but if you have a test environment, you could give it a try to verify.
Otherwise the best way is that have suggested @tapiocaPENGUIN !!

Best Regards

I think there would need to be downtime in the application or a code change at some point. Because even if you successfully add all the new hosts to the replica set the application will need to get the new connection strings at some point. Because I’m assuming the hostnames are going to to change.

Case 1: I believe this should work with no issues
Case 2: I wouldn’t do because you have two versions of mongodb and it just feels more awkward to me (if that is a valid reason :slight_smile: )
Case 3: Setup a new cluster on 4.4, upgrade and set fcv on old for 4.4, do a maint period and mongodump/restore to the new cluster, switch application conn string, test. This way if something fails on the new cluster you haven’t touched the old cluster, so you just failback your app to the old connection string and you are back and running.

4 posts were split to a new topic: Issue backing up system databases with mongodump after upgrading to 4.4