0) Based on the docs (https://docs.mongodb.org/manual/release-notes/3.2-upgrade/#upgrade-replica-set) it sounds like /no/ members of the replica set can be running 3.2 until they are /all/ running at least 3.0 - is that correct?
Hi Dave,
That is correct. In order to upgrade to MongoDB v3.2, all of the replica set members must be running v3.0. You can not have a mix of v2.6 and v3.2 in your replica set.
1) Is this really a viable plan, to have a replica set with both 2.x and 3.x nodes simultaneously? It’s perfectly ok with us if the 3.x nodes can’t use all the newer functionality til the migration is done - we’re just looking for a process that gets us there with limited downtime. If so, is there any special way we need to configure the 3.x nodes while they coexist with the 2.x nodes to make sure they all play nicely together?
Just to clarify that stating v2.x and v3.x is very broad. I assumed that you are meaning to say v2.6 and v3.0.
See MongoDB Version Numbers for more info on MongoDB release series.
As per the upgrade notes, before enabling the new WiredTiger storage engine, ensure that all replica set members are running at least v2.6.8, and preferably v3.0.8 or newer.
You can perform a rolling upgrade of a replica set with MongoDB v2.6 and v3.0. Although running a mixed version is supported for the purposes of upgrading your replica set, you should not run with this configuration for longer than is required.
Similarly, once the migrations are done, are there any settings we should change to take advantage of newer functionality?
There are a number of updates in v3.0. If you are wanting to take advantage of the new WiredTiger storage engine, see change storage engine to WiredTiger for the steps involved.
2) How can we go about minimizing the number of primary elections? (or other things that would cause the replica set to be temporarily unavailable) As in, could we add new nodes as secondaries and have them be used and then at some point force an election to one of the new primaries? (I know how to force an election to a new node, but am less sure about adding secondaries and getting traffic to them without forcing an election - e.g. doesn’t a rs.reconfig always trigger an election?)
Few points to clarify:
rs.reconfig() does not always trigger an election (at least in v2.6.8+).Our application uses a read preference of ‘nearest’ for a lot of our traffic, as in many cases eventually consistent data is fine, so most of our secondaries handle a lot of traffic on an ongoing basis, so we’d want to be able to add the 3.x secondaries and get traffic to them to test things out before going too far. It’d just be nice to add them without causing an election each time.
As with any systems upgrade, you should always test in a development or staging environment first. You should test the client application code as well for any code/driver incompatibility issues before testing in production.
Also I would recommend to check the compatibility changes notes carefully as well. A few points to be aware of:
--auth or restoring a pre-upgrade backup. The authSchemaUpgrade discards MONGODB-CR authentication credentials used in v2.6.Once you have all the members upgraded to v3.0, please check the upgrade notes for v3.0 to v3.2 which is different from v2.6 to v3.0.
Lastly make sure to use the latest stable release of MongoDB for bug fixes and general enhancements. Currently for v3.0 it is v3.0.8, and for v3.2 it is v3.2.1
Best regards,
Wan.