Docs Menu

Configure Maintenance Window

You can set the hour of the day when Atlas should start weekly maintenance on your cluster. This setting is optional and is not required for most clusters. Configure maintenance windows from your project settings.

Typically, you do not need to manually configure a maintenance window. Atlas performs maintenance automatically in a rolling manner to preserve continuous availability for resilient applications. You can use the Test Failover capability to ensure that your application is resilient to replica set elections.

Configuring maintenance windows provides more control over the timing of maintenance by allowing maintenance that requires replica set elections to occur at your preferred time of day, and other standard updates to occur outside of business-critical hours.

Atlas may perform urgent maintenance activities (such as security patches for zero-day vulnerabilities) as soon as necessary without regard to configured maintenance windows or protected hours.

Once you schedule a maintenance window for your cluster, you cannot change it until any ongoing maintenance operations have completed.

If maintenance includes a MongoDB patch version upgrade, Atlas displays the current and target versions in the console.

Atlas performs maintenance the same way as the maintenance procedure described in the MongoDB Manual. This procedure requires at least one replica set election during the maintenance window per replica set.

Use the Test Failover capability to ensure that your application is resilient to replica set elections.

Maintenance always begins as close to the scheduled time as possible, but in-progress cluster updates or unexpected system issues could delay the start time.

If you have low Disk IOPS, your cluster could experience a brief performance degradation during maintenance while MongoDB repopulates the WiredTiger storage engine. See Journaling and the WiredTiger Storage Engine to learn more.

In addition to configuring a maintenance window, you can set daily protected hours, which is a window of time during which Atlas avoids performing standard updates.

Atlas automatically performs maintenance during the maintenance window. However, Atlas may perform standard updates that do not involve a cluster restart or impact workload performance, outside of the maintenance window. When you enable protected hours, Atlas performs standard updates outside of the protected hours window.

The length of your protected hours window cannot exceed 18 hours.

To manage maintenance windows, you must have Organization Owner or Project Owner access to the project.

1

Warning

Navigation Improvements In Progress

We're currently rolling out a new and improved navigation experience. If the following steps don't match your view in the Atlas UI, see the preview documentation.

  1. If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.

  2. If it's not already displayed, select your desired project from the Projects menu in the navigation bar.

  3. Next to the Projects menu, expand the Options menu, then click Project Settings.

    The Project Settings page displays.

2

To return the details for the maintenance window using the Atlas CLI, run the following command:

atlas maintenanceWindows describe [options]

To update the maintenance window using the Atlas CLI, run the following command:

atlas maintenanceWindows update [options]

To learn more about the syntax and parameters for the previous commands, see the Atlas CLI documentation for atlas maintenanceWindows describe and atlas maintenanceWindows update.

To view and configure the maintenance window using the Atlas UI:

  1. Click the Set Maintenance Window button to display the maintenance window settings.

  2. Set the day and time that you want Atlas to start maintenance on your project.

  3. If you want Atlas to automatically defer any scheduled maintenance for one week, click Automatically defer maintenance for one week.

  4. To set a range of protected hours in which Atlas avoids performing standard updates, toggle the Turn on protected hours setting to On. You can set a maximum time range of 18 hours a day.

  5. Click Save to keep your changes or click Cancel to discard them.

If you configured a preferred maintenance window start time, you can clear the settings using the Atlas CLI or the Atlas UI. Clearing your maintenance window configuration restores the default maintenance window settings.

To clear the configured maintenance window using the Atlas CLI, run the following command:

atlas maintenanceWindows clear [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas maintenanceWindows clear.

To clear the configured maintenance window using the Atlas UI, toggle the Set Maintenance Window setting to Off.

When maintenance is required, Atlas:

  • Displays a banner in your project's cluster list showing the date and time when the maintenance is scheduled.

  • Sends a notification email to users with the Project Owner role between 48 and 72 hours before the scheduled maintenance.

    Note

    To configure how you receive scheduled maintenance window notifications, see Configure a Maintenance Window Alert.

To defer the maintenance window using the Atlas CLI, run the following command:

atlas maintenanceWindows defer [options]

To learn more about the command syntax and parameters, see the Atlas CLI documentation for atlas maintenanceWindows defer.

With this information, you can choose one of three options in the Atlas UI:

  1. Do nothing. The maintenance occurs during your scheduled maintenance window.

  2. Select Begin Maintenance Now. The scheduled maintenance starts immediately. If you choose this option, Atlas asks you to confirm it in a separate modal.

  3. Select Defer Maintenance for One Week. The scheduled maintenance starts during your preferred maintenance window one week after the given scheduled maintenance date and time. If you choose this option, Atlas asks you to confirm it in a separate modal.

    Note

    You can defer a single project maintenance event up to two times.

If Atlas will upgrade the MongoDB maintenance version on one of your clusters during the next maintenance window, the cluster's card displays the target MongoDB maintenance version.

Screenshot of electable nodes across three regions
click to enlarge