Company
Date Published
Author
Bryan Reinero
Word count
2889
Language
English
Hacker News points
None

Summary

To minimize downtime during maintenance, MongoDB provides a feature called "rolling upgrades," which allows you to perform maintenance tasks on each secondary node one by one while keeping the primary node available. This ensures that the system remains available and performs well even when performing heavy weight maintenance tasks like compaction or index build. The process involves shutting down each secondary node in stand-alone mode, executing the maintenance task, restarting it in replSet mode once the task is complete, and repeating this process for each secondary node until the primary node is the last one to be maintained. To ensure a smooth process, you need to plan ahead by checking the oplog size, stepping down the primary predictably, maintaining fault tolerance during maintenance, and taking care when building indexes. Additionally, MongoDB Cloud Manager can simplify the maintenance process by automating tasks like upgrading the cluster version, adding or removing nodes, and performing index builds.