Friday, June 8, 2018

Upgrade Storage Engine - mmapv1 to wiredTiger – Outline


mmapv1 to wiredTiger

This Outline is based on MongoDB documentation.

Procedure

Shards

1) Shut down the secondary member.

# db.shutdownServer()

2) Prepare a data directory or delete all datas for the new mongod running with WiredTiger.

3) Start mongod with WiredTiger.

storage:
  engine: wiredTiger
(or)
delete the storage.engine field

4) Repeat the procedure for other replica set secondaries you wish to upgrade.

Config servers

1) Disable the balancer.

# sh.disableBalancer()

2) Shutdown the third config server

Shutdown the third config server to ensure read-only metadata. - 3rd config server

# db.shutdownServer()

3) Export the data of the second config server

Export the data of the second config server with mongodump. - 2nd config server

# mongodump --out <exportDataDestination>

4) Second config server

For the second config server, create a new data directory for use with WiredTiger. - 2nd config server

5) Stop the second config server. - 2nd config server

# db.shutdownServer()

6) Start the second config server mongod

Start the second config server mongod with the WiredTiger storage engine option. - 2nd config server - with wiredTiger option

7) Upload the exported data in second config server

Upload the exported data using mongorestore to the second config server. - 2nd config server - 2nd completed

# mongorestore <exportDataDestination>

8) Shut down the second config server

Shut down the second config server to ensure read-only metadata. - 2nd config server

# db.shutdownServer()

9) Restart the third config server

Restart the third config server to prepare for its upgrade. - 3rd config server - without wiredTiger option

10) Export the data of the third config server

Export the data of the third config server with mongodump. - 3rd config server

# mongodump --out <exportDataDestination>

11) Third Config Server

For the third config server, create a new data directory for use with WiredTiger. - 3rd config server

12) Stop the third config server

Stop the third config server. - 3rd config server

# db.shutdownServer()

13) Start the third config server

Start the third config server with the WiredTiger storage engine option. - 3rd config server - with wiredTiger option

14) Upload the exported data in third config server

Upload the exported data using mongorestore to the third config server. - 3rd config server

15) Export data of the first config server

Export data of the first config server with mongodump. - 1st config server

# mongodump --out <exportDataDestination>

16) First Config Server

For the first config server, create a new data directory for use with WiredTiger. - 1st config server

17) Stop the first config server

Stop the first config server. - 1st config server

# db.shutdownServer()

18) Start the first config server

Start the first config server with the WiredTiger storage engine option. - 1st config server

19) Upload the exported data in first config server

Upload the exported data using mongorestore to the first config server. - 1st config server

# mongorestore <exportDataDestination>

20) Restart the second config server

Restart the second config server to enable writes to the sharded cluster’s metadata. - 2nd config server - with wiredTiger option

21) Re-enable the balancer.

# sh.startBalancer()

No comments:

Post a Comment