Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for MongoDB
  • Getting started
    • Resource relationships
    • Network in Yandex Managed Service for MongoDB
    • Quotas and limits
    • Storage in Yandex Managed Service for MongoDB
    • Backups
    • Replication and fault tolerance
    • Sharding
    • Users and roles
    • Maintenance
    • Supported clients
    • MongoDB settings
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Maintenance window
  • Maintenance procedure
  • Non-sharded cluster
  • Sharded cluster
  1. Concepts
  2. Maintenance

Maintenance in Managed Service for MongoDB

Written by
Yandex Cloud
Improved by
Dmitry A.
Updated at January 23, 2025
  • Maintenance window
  • Maintenance procedure
    • Non-sharded cluster
    • Sharded cluster

Maintenance means:

  • Automatic installation of DBMS updates and fixes for hosts (including for disabled clusters).
  • Other maintenance activities.

Changing a major DBMS version is not part of maintenance. For more information about version changes, see MongoDB version upgrade.

Maintenance windowMaintenance 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 procedureMaintenance procedure

The Managed Service for MongoDB cluster maintenance procedure depends on the number of hosts and the presence of shards.

Non-sharded clusterNon-sharded cluster

The maintenance procedure is as follows:

  1. Secondary replicas undergo maintenance one by one. The hosts are queued randomly. A secondary replica becomes unavailable while being restarted during maintenance.
  2. 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 clusterSharded cluster

In sharded clusters, the maintenance procedure is as follows:

  1. The load balancer stops.

  2. Hosts with the MONGOINFRA role for standard sharding or MONGOCFG for advanced sharding undergo maintenance one by one. For hosts with the MONGOINFRA role, only MongoCFG is subject to maintenance. Host maintenance is run in the same way as it would in a non-sharded cluster:

    1. Secondary replicas undergo maintenance one by one. The hosts are queued randomly. A secondary replica becomes unavailable while being restarted during maintenance.
    2. Then, the primary replica undergoes maintenance. If it is restarted and becomes unavailable, one of the secondary replicas will take its role.
  3. 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:

    1. Secondary replicas undergo maintenance one by one. The hosts are queued randomly. A secondary replica becomes unavailable while being restarted during maintenance.
    2. 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.
  4. Hosts with the MONGOINFRA role for standard sharding or MONGOS for advanced sharding undergo maintenance one by one. For hosts with the MONGOINFRA 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.

  5. The load balancer resumes its operation.

Was the article helpful?

Previous
Users and roles
Next
Supported clients
© 2025 Direct Cursus Technology L.L.C.