0

I have upgraded the mongodb from 3.0.15 to 3.2

mongodb3.0.15 Configuration :

Three shards

Three config servers

mongodb3.2 Configuration :

Three shards

Three config servers No replica sets

I just upgraded the mongodb to 3.2 Started the mongo services by pointing it to the 3.2 binaries

Mongo Script:

mongod --keyFile C:\mongoConfigData\key --configsvr --dbpath C:\mongoConfigData/configdb1 --port 27019 --storageEngine wiredTiger

mongod --keyFile C:\mongoConfigData\key --configsvr --dbpath C:\mongoConfigData/configdb2 --port 27020 --storageEngine wiredTiger

mongod --keyFile C:\mongoConfigData\key --configsvr --dbpath C:\mongoConfigData/configdb3 --port 27021 --storageEngine wiredTiger

mongos --keyFile C:\mongoConfigData\key --configdb 127.0.0.1:27019,127.0.0.1:27020,127.0.0.1:27021

mongod --keyFile C:\mongoConfigData\key --config C:\mongoConfigData\mongod.config --dbpath e:\data --storageEngine wiredTiger --wiredTigerJournalCompressor zlib --wiredTigerCollectionBlockCompressor zlib --wiredTigerCacheSizeGB 7 --port 27010

mongod --keyFile C:\mongoConfigData\key --config C:\mongoConfigData\mongod.config --dbpath f:\data --storageEngine wiredTiger --wiredTigerJournalCompressor zlib --wiredTigerCollectionBlockCompressor zlib --wiredTigerCacheSizeGB 7 --port 27011

mongod --keyFile C:\mongoConfigData\key --config C:\mongoConfigData\mongod.config --dbpath g:\data --storageEngine wiredTiger --wiredTigerJournalCompressor zlib --wiredTigerCollectionBlockCompressor zlib --wiredTigerCacheSizeGB 7 --port 27012

But after the upgrade i could see that the sharding has gone for toss. Now when i try to view the shards it says that the collection is not sharded. Let me know if i am missing anything.

0

As per MongoDB documentation here To Upgrade a Replica Set to 3.2, All replica set members must be running version 3.0 before you can upgrade them to version 3.2. To upgrade a replica set from an earlier MongoDB version, upgrade all members of the replica set to the latest 3.0-series release first, and then follow the procedure to upgrade from MongoDB 3.0 to 3.2.

Upgrade Binaries

You can upgrade from MongoDB 3.0 to 3.2 using a rolling upgrade to minimize downtime by upgrading the members individually while the other members are available:

Avoid reconfiguring replica sets that contain members of different MongoDB versions as validation rules may differ across MongoDB versions.

Upgrade secondary members of the replica set

Upgrade the secondary members of the replica set one at a time:

  1. Shut down the mongod instance and replace the 3.0 binary with the 3.2 binary.
  2. Restart the member and wait for the member to recover to SECONDARY state before upgrading the next secondary member. To check the member’s state, issue rs.status() in the mongo shell.

Step down the replica set primary

Connect a mongo shell to the primary and use rs.stepDown() to step down the primary and force an election of a new primary:

Upgrade the primary

When rs.status() shows that the primary has stepped down and another member has assumed PRIMARY state, upgrade the stepped-down primary:

  1. Shut down the stepped-down primary and replace the mongod binary with the 3.2 binary.
  2. Restart.

Note : MongoDB 3.2 generates core dumps on some mongod failures. For production environments, you may prefer to turn off core dumps for the operating system, if not already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.