Procedure to upgrade sharded replica set to 2.6

44 views
Skip to first unread message

Richard Knaggs

unread,
Feb 25, 2015, 9:49:32 AM2/25/15
to mongod...@googlegroups.com
Hi,

I am wanting to upgrade our cluster which has two shards and three replica sets from version 2.4 to 2.6. I have read the various documents on the MongoDB website and have successfully run db.upgradeCheckAllDBs(), however most of the documentation I have seen relates to upgrading standalone instances whereas I am upgrading an Ubuntu server using apt-get. Can anyone let me know the procedure for performing this upgrade?

I presume I need to disable the balancer and then upgrade the secondary servers first but will upgrading using apt-get successfully upgrade the mongod instance, any mongos instance and any config server at the same time? If I do this initially on the secondary servers won't this leave the primary servers running version 2.4 while the secondary servers are on version 2.6? Will this mix of versions work until I upgrade the primary servers?

Thanks in advance for your help.

Richard.

Stephen Steneker

unread,
Feb 26, 2015, 8:34:49 AM2/26/15
to mongod...@googlegroups.com
On Thursday, 26 February 2015 01:49:32 UTC+11, Richard Knaggs wrote:
I am wanting to upgrade our cluster which has two shards and three replica sets from version 2.4 to 2.6. I have read the various documents on the MongoDB website and have successfully run db.upgradeCheckAllDBs(), however most of the documentation I have seen relates to upgrading standalone instances whereas I am upgrading an Ubuntu server using apt-get. Can anyone let me know the procedure for performing this upgrade?

Hi Richard,

The standard procedures for upgrading a sharded cluster to MongoDB 2.6 are described in the upgrade guide: http://docs.mongodb.org/manual/release-notes/2.6-upgrade/#upgrade-a-sharded-cluster-to-2-6.


I presume I need to disable the balancer and then upgrade the secondary servers first but will upgrading using apt-get successfully upgrade the mongod instance, any mongos instance and any config server at the same time?

Presumably these are all running on different hosts, so you have some control over the order in which servers are upgraded. There is a manual step to upgrade the cluster metadata via a single mongos (as noted in the upgrade guide) so you'll want to follow the upgrade instructions rather than apt-get upgrading servers en-masse.

 
If I do this initially on the secondary servers won't this leave the primary servers running version 2.4 while the secondary servers are on version 2.6? Will this mix of versions work until I upgrade the primary servers?

As noted in the upgrade guide, you can minimize downtime by doing a rolling upgrade from a 2.4 to 2.6 replica set. This involves upgrading the secondaries one at a time and finally stepping down and upgrading the primary. It's fine to transiently have mixed 2.4/2.6 nodes in the replica set, but obviously not recommendable long term given potential differences between versions & features.

An obvious caveat for any major version upgrades: before upgrading in production, please test with production-like workloads in a staging environment. Aside from running db.updateCheckAllDBs(), you should also have a read of the Compatibility Changes that might affect your application.

Regards,
Stephen

Richard Knaggs

unread,
Feb 27, 2015, 7:35:24 AM2/27/15
to mongod...@googlegroups.com
Hi Stephen,

Thanks for that information, it clarifies a lot of things for me. The issue I have is that my servers aren't all running on different hosts - for example on one server I may have a mongos instance and a mongod instance, on another server I may have a config server running alongside a mongod instance. So it seems that I can't upgrade these individually, using apt-get would upgrade the mongos and the mongod instances at the same time which is not what the document recommends. Is there any way round this or do I need to download the binaries direct from MongoDB rather than use apt-get?

Thanks,
Richard.
Reply all
Reply to author
Forward
0 new messages