How to perform a minor upgrade on a sharded cluster
To upgrade to a major version, please perform a cluster migration via backup
Note: This feature is only available on specific revisions in Charmed MongoDB 6/stable
, listed here.
If you wish to upgrade to/from a different revision, then perform a cluster migration via backup
Minor upgrade steps
Here is a summary of the steps to perform a minor upgrade.:
- Determine your current revision
- Determine new revision
- Upgrade config-server
- Upgrade shards
- Upgrade mongos applications
Step 1: Determine your current revision
Find determine your current revision:
juju status | grep <juju-app-name> | head -1 | awk '{print $5}'
If your current revision is not in the list of available revisions to upgrade to, then you must perform a cluster migration via backup
This will not be used in the remainder of this How-To. But in the case that your upgrade is unsuccessful you will need this revision number to rollback your application.
Step 2: Determine new revision
Choose a revision to upgrade to from the list of available revisions to upgrade to. By the end of your upgrade the config-servers and shards must all be on the same revision.
Step 3: Upgrade config-server
To upgrade your config-server follow the instructions in how to upgrade a replica set
Do not proceed if this step was not successful. If your upgrade failed, rollback the cluster
Step 4: Begin upgrade
If you succeeded in upgrade your config-server in Step 3, you may proceed to upgrade your shards.
Upgrade each shard one at a time. Start by upgrading the first shard and follow the instructions in how to upgrade a replica set.
Upgrade the next shard only when the current upgrade succeeds - i.e all units show active
and idle
statuses.
Do not proceed if an upgrade of a shard fails. If an upgrade fails, rollback the entire cluster.
Step 5: Upgrade mongos applications
Next, upgrade any integrated mongos applications by following the Charmed Mongos Documentation guide on How to perform a minor version upgrade.