All Products
Search
Document Center

ApsaraDB for MongoDB:Modify replica set instance configuration

Last Updated:Jun 04, 2026

Scale an ApsaraDB for MongoDB replica set instance up or down by modifying its configuration.

Billing

Billing for instance configuration changes.

Limitations

  • To change the number of read-only nodes on an instance in a Classic Network, first enable a public endpoint or switch to a Read-only Nodes.

  • Storage space cannot be decreased during a configuration change. Instead, create a new instance with smaller storage and migrate your data. Scenarios and solutions for other configuration changes.

  • Instance type (for example, replica set to sharded cluster) and storage type cannot be changed during a configuration change. Instead, create a new instance and migrate your data. Scenarios and solutions for other configuration changes.

Considerations

  • Configuration change duration depends on network conditions, queue length, and data volume. Perform this operation during off-peak hours and ensure your application supports automatic reconnection.

  • For General-purpose or Dedicated local disk instances, storage-only expansions are performed in place if the host has sufficient resources. This avoids cross-host migration and service switchovers, and takes effect immediately without connection interruptions, regardless of the switchover time setting.

  • For cloud disk instances, storage-only expansions take effect immediately without connection interruptions, regardless of the switchover time setting.

  • Expect one or two brief disconnections of about 30 seconds each during the change. To reduce impact, schedule the change using the Switch time option.

  • A configuration change does not cause data loss.

  • Modifying a local disk instance automatically upgrades its minor database version to the latest version.

  • Local disk instance modifications take significantly longer than cloud disk modifications, which typically complete within one hour.

    Factors that affect the duration of a configuration change

    If the host physical server lacks sufficient resources, modifying a local disk instance triggers a cross-host migration, which significantly increases the duration. If the host has sufficient resources, the change is applied in place. The following table lists the key factors.

    Storage type

    Cross-host migration

    Influencing factor

    Description

    Local disk

    No

    Number of databases and collections

    Configuration changes restart the nodes. More databases and collections increase startup time. Regularly remove unused ones. Instance slowdowns or exceptions due to an excessive number of databases and collections.

    Ongoing index creation

    Configuration changes restart the nodes. In-progress index creation forces a rebuild, increasing startup time.

    Yes

    Total data size

    Total data size affects migration and synchronization time. Migration speed is limited by the network bandwidth of the instance type.

    Incremental data write rate

    Higher write rates increase the time for the new node to synchronize incremental data.

    Oplog retention period

    If the Oplog retention period is too short, incremental logs may be overwritten, causing synchronization failure. Ensure the retention period meets: Retention Period (hours) ≥ Used Data Space (GB) / 10 (GB/hour).

    Daily backup status

    Data can be migrated using backup sets if daily backups have minimal disk fragmentation and a sufficient Oplog retention period.

    Number of indexes

    More indexes increase the index creation time on the new node during synchronization.

    Number of databases and collections

    More databases and collections increase synchronization time on the new node.

    Cloud disk

    No

    -

    Cloud disk configuration changes use snapshots and complete quickly. The factors above do not apply.

    Note

    Use cloud disk instances for time-sensitive scenarios.

Procedure

  1. Navigate to the ApsaraDB for MongoDB Replica Set Instances page, select a resource group and region at the top, and then click the ID of the target instance.

  2. In the Specification Information section, open the configuration change page based on your billing method.

    • Subscription instances

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

    • Pay-as-you-go instances

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

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

    Change type

    Parameter

    Description

    • Upgrade

    • Downgrade

    Active-standby Nodes

    The number of primary and secondary nodes. Valid values:

    • Three Replica Set Nodes: Downgrades are not supported.

    • 5: You can downgrade to a Three Replica Set Nodes instance.

    • 7: You can downgrade to a Three Replica Set Nodes or 5 instance.

    Read-only Nodes

    The number of read-only nodes. Valid values: 0 to 5.

    Specifications

    The instance class. For supported replica set instance classes, see Instance types.

    Storage Space

    The storage space of the instance.

    Note

    Switch time

    Select when the configuration change takes effect.

    • Switch Immediately After Data Migration: Applies the change immediately after data migration completes.

    • Switch Within Maintenance Window: Applies the change within the maintenance window. You can keep the current window or set a new one.

      1. Click Switch Within Maintenance Window next to Modify.

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

    Note
    • For General-purpose or Dedicated local disk instances, storage-only expansions are performed in place if the host has sufficient resources. This avoids cross-host migration and service switchovers, and takes effect immediately without connection interruptions, regardless of the switchover time setting.

    • For cloud disk instances, storage-only expansions take effect immediately without connection interruptions, regardless of the switchover time setting.

  4. Read and agree to the terms of service, click Buy Now, and then follow the on-screen instructions to complete the payment.

    During the configuration change, the instance status is In the process of matching. When the status changes to Running, the configuration change is complete and the new configuration takes effect.

Related APIs

API

Description

ModifyDBInstanceSpec

Changes the instance specification or storage capacity of an ApsaraDB for MongoDB standalone or replica set instance.