As per MongoDB BOL Upgrade MongoDB to 3.0 In the general case, the upgrade from
MongoDB 2.6 to
3.0 is a binary-compatible “drop-in” upgrade: shut down the mongod instances and replace them with mongod instances running 3.0. However, before you attempt any upgrade please familiarize yourself with the content of this document, particularly the procedure for upgrading sharded clusters.
If you need guidance on upgrading to 3.0, MongoDB offers consulting to help ensure a smooth transition without interruption to your MongoDB application.
You can upgrade from
MongoDB 2.6 to
3.0 using a rolling upgrade to minimize downtime by upgrading the members individually while the other members are available:
There is simple three steps through which you can upgrade
Upgrade secondary members of the replica set
Upgrade the secondary members of the set one at a time by shutting down the mongod and replacing the 2.6 binary with the 3.0 binary. After upgrading a mongod instance, wait for the member to recover to SECONDARY state before upgrading the next instance. To check the member’s state, issue rs.status() in the mongo shell.
Step down the replica set primary
Use rs.stepDown() in the mongo shell to step down the primary and force the set to failover. rs.stepDown() expedites the failover procedure and is preferable to shutting down the primary directly.
Upgrade the primary
When rs.status() shows that the primary has stepped down and another member has assumed PRIMARY state, shut down the previous primary and replace the mongod binary with the 3.0 binary and start the new instance.
Replica set failover is not instant and will render the set unavailable to accept writes until the failover process completes. This may take 30 seconds or more: schedule the upgrade procedure during a scheduled maintenance window.