All Products
Search
Document Center

ApsaraDB for MongoDB:Change the configurations of a replica set instance

Last Updated:Aug 15, 2025

You can change the configurations of an ApsaraDB for MongoDB replica set instance if its current specifications do not meet your business requirements.

Billing rules

For more information, see Configuration change fees.

Limits

  • If the instance uses the Classic Network, you must enable public access or switch to a virtual private cloud (VPC) to change the Number Of Read-only Nodes.

  • You cannot reduce the storage space of an instance when you change its configurations. To reduce the storage space, you must create a new instance to replace the original one. For more information, see Other configuration change scenarios and methods.

  • You cannot change the instance type or storage class when you change configurations. For example, you cannot change a replica set instance to a sharded cluster instance. To change the instance type or storage class, you must create a new instance to replace the original one. For more information, see Other configuration change scenarios and methods.

Usage notes

  • The time required to complete a configuration change depends on factors such as network conditions, the task queue, and the data volume. Change the instance configurations during off-peak hours and ensure that your application has an automatic reconnection mechanism.

  • For general-purpose or dedicated instances with local disks, if you only scale out storage and the host physical machines have sufficient resources, the scale-out is performed locally without a migration or switchover. The change takes effect immediately without connection interruptions, regardless of the selected switch time.

  • For instances that use cloud disks, if you only scale out the storage space, the configuration change takes effect immediately. This process does not cause connection interruptions, regardless of the selected switchover time.

  • During a configuration change, one or two transient connections may occur, each lasting for approximately 30 seconds. Set the Switching Time to an off-peak period to specify when the configuration change takes effect and to prevent service interruptions.

  • Configuration changes do not cause data loss.

  • When you change the configurations of an instance that uses local disks, the system, by default, upgrades the minor database version to the latest version.

Procedure

  1. Go to the MongoDB replica set instances page. At the top of the page, select a resource group and a region. Then, click the ID of the target instance.

  2. In the Specification Information section, follow the appropriate step for your instance's billing method to navigate to the configuration change page.

    • Subscription instance

      In the upper-right corner of the Specification Information section, click Upgrade or Downgrade.

    • Pay-as-you-go instance

      In the upper-right corner of the Specification Information section, click Change Configurations.

  3. On the configuration change page, set the following parameters.

    Change Type

    Parameter

    Description

    • Upgrade Configuration

    • Downgrade Configuration

    Primary And Secondary Nodes

    Select the number of primary and secondary nodes. Valid values:

    • Three Nodes: Downgrade is not supported.

    • Five Nodes: Can be downgraded to Three Nodes.

    • Seven Nodes: Can be downgraded to Three Nodes or Five Nodes.

    Number Of Read-only Nodes

    Select the number of read-only nodes. The value must be an integer from 0 to 5.

    Instance Type

    Select the new instance type. For more information about the instance types that replica set instances support, see Instance types.

    Storage Space

    Select the new storage space.

    Note
    • You cannot reduce the storage space of an instance when you change its configurations. To reduce the storage space, you must create a new instance to replace the original one. For more information, see Other configuration change scenarios and methods.

    • The storage space that you select is for each node, not the total storage space of all nodes.

    Switching Time

    Select when the configuration change takes effect.

    • Switch Immediately After Data Migration: The system applies the change immediately after data migration is complete.

    • Switch Within Maintenance Window: The system applies the change within the specified maintenance window. You can use the current maintenance window or set a new one.

      1. Click Modify next to Switch Within Maintenance Window.

      2. In the Specification Information section, click Edit next to Maintenance Window to set the switchover time. For more information, see Set a maintenance window.

    Note
    • For general-purpose or dedicated instances with local disks, if you only scale out storage and the host physical machines have sufficient resources, the scale-out is performed locally without a migration or switchover. The change takes effect immediately without connection interruptions, regardless of the selected switch time.

    • For instances that use cloud disks, if you only scale out the storage space, the configuration change takes effect immediately. This process does not cause connection interruptions, regardless of the selected switchover time.

  4. Read and select the Terms of Service, click Buy Now, and then complete the payment as prompted.

    When you change the configurations of the instance, the instance status is Changing Configuration. If the instance status changes to Running, the instance configurations are changed.

Related API operations

Operation

Description

ModifyDBInstanceSpec

Changes the specifications or storage capacity of a standalone or replica set instance.