Maintenance in Managed Service for MongoDB
Maintenance means:
- Automatic installation of MySQL updates and fixes for hosts (including disabled clusters).
- Changes to the host class and storage size.
- Other maintenance activities.
Changing a major DBMS version is not part of maintenance. For more information about version changes, see Upgrading the MongoDB version.
Maintenance window
You can set up a maintenance window when creating or updating a cluster:
- The arbitrary option (default) allows performing maintenance at any time.
- The by schedule option allows setting the preferred maintenance start day and time (UTC). For example, you can choose a time when the cluster is least loaded.
Maintenance procedure
The Managed Service for MongoDB cluster maintenance procedure depends on the number of hosts and the presence of shards.
Non-sharded cluster
The maintenance procedure is as follows:
- Secondary replicas undergo maintenance one by one. The hosts are queued randomly. A secondary replica becomes unavailable while being restarted during maintenance.
- After that, the primary replica (master) undergoes maintenance. If it is restarted and becomes unavailable, one of the secondary replicas will take its role. A single-host cluster will be unavailable during its maintenance.
Sharded cluster
In sharded clusters, the maintenance procedure is as follows:
-
The load balancer stops.
-
Hosts with the
MONGOINFRA
role for standard sharding orMONGOCFG
for advanced sharding undergo maintenance one by one. For hosts with theMONGOINFRA
role, only MongoCFG is subject to maintenance. Host maintenance is run in the same way as it would in a non-sharded cluster:- Secondary replicas undergo maintenance one by one. The hosts are queued randomly. A secondary replica becomes unavailable while being restarted during maintenance.
- Then, the primary replica undergoes maintenance. If it is restarted and becomes unavailable, one of the secondary replicas will take its role.
-
Shards undergo maintenance one by one, in ascending order by shard number. Host maintenance in each shard is the same as in non-sharded clusters:
- Secondary replicas undergo maintenance one by one. The hosts are queued randomly. A secondary replica becomes unavailable while being restarted during maintenance.
- Then, the primary replica undergoes maintenance. If it is restarted and becomes unavailable, one of the secondary replicas will take its role. A single-host shard will be unavailable during its maintenance.
-
Hosts with the
MONGOINFRA
role for standard sharding orMONGOS
for advanced sharding undergo maintenance one by one. For hosts with theMONGOINFRA
role, MongoS is subject to maintenance. The hosts are queued randomly. If a host needs to be restarted during maintenance, it becomes unavailable while being restarted. -
The load balancer resumes its operation.