Note: This feature is only available on specific revisions in Charmed MongoDB 6/stable
, listed here.
Perform a minor upgrade on a mongos router
This page contains:
- Supported charm revisions that are safe to upgrade to or from
- Minor upgrade steps
To perform an upgrade on a MongoDB sharded cluster, see the Charmed MongoDB documentation how-to guide.
Supported revisions
Below is a list of revisions of Charmed MongoDB that support upgrades. If you wish to upgrade to/from a different revision, then perform a cluster migration via backup.
Only upgrade to or from these supported revisions in a production environment.
No revisions support upgrades yet, please revisit this page at a later date.
Minor upgrade steps
Here is a summary of the steps to perform a minor upgrade.:
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 upgrade is not supported.
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
Step 3: Upgrade the router
Using the revision from Step 2, upgrade your application
juju refresh mongos --revision=<revision number>
The upgrade should begin, and upgrade all deployed mongos
routers. You can watch and wait for the upgrade to succeed with juju status --watch 1s
.
If all units show active
and idle
statuses after upgrading, then your upgrade succeeded.
If your upgrade failed, then juju status
will show that the unit is blocked with the message Unhealthy after refresh
. If the upgrade failed, you can:
- Recommended: Wait for 5-10 minutes to see if the router can heal itself
- Recommended: Rollback. To rollback complete redo Step 3 using the revision number from Step 1.
- Not Recommended: Force an upgrade by running
juju run mongos/leader force-refresh-start
. Please note this can break your database and is not recommended.