This topic describes how to change the configurations of a replica set instance. If the specifications of a replica set instance are higher or lower than required, you can change the configurations of the instance to better suit your business.

Billing

For more information, see Configuration change fees.

Limits

  • The new storage space that you specify must be greater than or equal to the existing storage space of the replica set instance.
  • The storage space of a replica set instance cannot be decreased. To decrease the storage space of a replica set instance, you can create another replica set instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
  • The architecture or storage engine of a replica set instance cannot be changed. For example, a replica set instance cannot be changed into a sharded cluster instance. If you require a different architecture or storage engine, you can create another replica set instance to replace the existing one. For more information, see Other configuration change scenarios and methods.

Precautions

  • The amount of time required to perform a configuration change depends on factors such as the network conditions, task queue status, and data volume. We recommend that you change the configurations of a replica set instance during off-peak hours and make sure that your application is configured to automatically re-establish a connection.
  • If you scale out only the storage space of a general-purpose or dedicated instance with local disks and the instance resides in a host that has sufficient resources, the scale-out is performed on the host without the need for cross-host migrations or failovers. In this case, the scale-out is immediately performed without the need to wait for the maintenance window.
  • During a configuration change, you may experience one or two transient connections. Each transient connection lasts about 30 seconds. To prevent a configuration change from interrupting your workloads, we recommend that you change configurations during off-peak hours.
  • Configuration changes do not result in data loss.
  • To ensure better performance and stability of the instance, the system will upgrade the minor version to the latest version by default. If the minor version of your instance expires or is not included in the maintenance list and the instance is upgraded, migrated, changed, Created from a backup, Created by point-in-time, or performed Restore one or more databases of an ApsaraDB for MongoDB instance.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and the region of the target instance.
  3. In the left-side navigation pane, click Replica Set Instances.
  4. On the Replica Set Instances page, find the replica set instance whose configurations you want to change.
  5. Go to the page on which you can change the configurations of the replica set instance. The available methods to change configurations vary based on the billing method of the instance.
    Subscription
    • Click the More icon icon in the Actions column corresponding to the instance, and select Upgrade or Downgrade.
    • Click the instance ID. In the Basic Information section, click Upgrade or Downgrade.
    Pay-as-you-go
    • Click the More icon icon in the Actions column corresponding to the instance, and select Change Configuration.
    • Click the instance ID. In the Basic Information section, click Change Configuration.
  6. Configure the following parameters.
    Note When you change the value of the Storage Space parameter, you must make sure that the new storage space that you specify is greater than or equal to the existing storage space of the replica set instance. To decrease the storage space of a replica set instance, you can create another replica set instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
    Billing method Change action Parameter Description
    Subscription Upgrade Nodes The number of nodes that can be selected when you change the configurations. Valid values:
    • Three Nodes Replicaset
    • Five Nodes Replicaset
    • Seven Nodes Replicaset
    Note You cannot change this configuration for replica set instances that run MongoDB 5.0 or 4.4.
    Read-only Nodes The number of read-only nodes that can be selected when you change the configurations. Valid values: 0 to 5.
    Note You cannot change this configuration for replica set instances that run MongoDB 5.0 or 4.4.
    Specification The specifications that can be selected when you change the configurations. For more information about the supported specifications of replica set instances, see Instance types.
    Storage Space The storage space that can be selected when you change the configurations.
    Switching Time The time when you want to apply the configuration change.
    • Switch Immediately After Data Migration: ApsaraDB for MongoDB immediately applies the configuration change after the payment is complete.
    • Switch Within Maintenance Window: ApsaraDB for MongoDB applies the configuration change within the maintenance window that you specify. You can view the maintenance window. You can also change the maintenance window by using one of the following methods:
      • Click Modify next to Switch Within Maintenance Window.
      • Go to the Basic Information page. In the Specification Information section, click Edit next to Maintenance Period. For more information, see Specify a maintenance period.
    Note If you scale out only the storage space of a general-purpose or dedicated instance with local disks and the instance resides in a host that has sufficient resources, the scale-out is performed on the host without the need for cross-host migrations or failovers. In this case, the scale-out is immediately performed without the need to wait for the maintenance window.
    Downgrade Nodes The number of nodes that can be selected when you change the configurations. Valid values:
    • Three Nodes Replicaset: cannot be downgraded.
    • Five Nodes Replicaset: can be downgraded to Three Nodes Replicaset.
    • Seven Nodes Replicaset: can be downgraded to Three Nodes Replicaset or Five Nodes Replicaset.
    Note You cannot change this configuration for replica set instances that run MongoDB 5.0 or 4.4.
    Read-only Nodes The number of read-only nodes that can be selected when you change the configurations.
    Note You cannot change this configuration for replica set instances that run MongoDB 5.0 or 4.4.
    Specification The specifications that can be selected when you change the configurations. For more information about the supported specifications of replica set instances, see Instance types.
    Switching Time The time when you want to apply the configuration change.
    • Switch Immediately After Data Migration: ApsaraDB for MongoDB immediately applies the configuration change after the payment is complete.
    • Switch Within Maintenance Window: ApsaraDB for MongoDB applies the configuration change within the maintenance window that you specify. You can view the maintenance window. You can also change the maintenance window by using one of the following methods:
      • Click Modify next to Switch Within Maintenance Window.
      • Go to the Basic Information page. In the Specification Information section, click Edit next to Maintenance Period. For more information, see Specify a maintenance period.
    Pay-as-you-go
    • Upgrade
    • Downgrade
    Nodes The number of nodes that can be selected when you change the configurations. Valid values:
    • Three Nodes Replicaset: cannot be downgraded.
    • Five Nodes Replicaset: can be downgraded to Three Nodes Replicaset.
    • Seven Nodes Replicaset: can be downgraded to Three Nodes Replicaset or Five Nodes Replicaset.
    Note You cannot change this configuration for replica set instances that run MongoDB 5.0 or 4.4.
    Read-only Nodes The number of read-only nodes that can be selected when you change the configurations.
    Note You cannot change this configuration for replica set instances that run MongoDB 5.0 or 4.4.
    Specification The specifications that can be selected when you change the configurations. For more information about the supported specifications of replica set instances, see Instance types.
    Storage Space The storage space that can be selected when you change the configurations.
    Note The storage space of ApsaraDB for MongoDB instances cannot be decreased. To decrease the storage space of an ApsaraDB for MongoDB instance, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
    Switching Time The time when you want to apply the configuration change.
    • Switch Immediately After Data Migration: ApsaraDB for MongoDB immediately applies the configuration change after the payment is complete.
    • Switch Within Maintenance Window: ApsaraDB for MongoDB applies the configuration change within the maintenance window that you specify. You can view the maintenance window. You can also change the maintenance window by using one of the following methods:
      • Click Modify next to Switch Within Maintenance Window.
      • Go to the Basic Information page. In the Specification Information section, click Edit next to Maintenance Period. For more information, see Specify a maintenance period.
    Note If you scale out only the storage space of a general-purpose or dedicated instance with local disks and the instance resides in a host that has sufficient resources, the scale-out is performed on the host without the need for cross-host migrations or failovers. In this case, the scale-out is immediately performed without the need to wait for the maintenance window.
  7. Perform the corresponding operations based on the selected billing method.
    • If the billing method is pay-as-you-go, read and select MongoDB Replica Set (Pay-as-you-go) Terms of Service. Then, click Buy Now and the system automatically collects the amount in the next hour.
    • If the billing method is subscription, read and select MongoDB Replica Set (Subscription) Terms of Service, and click Buy Now. Then, complete the payment on the Purchase page.
    When the configuration change is being applied, the standalone instance is in the Changing Configuration state. When the configuration change is complete, the state of the instance changes to Running.

Related API operations

Operation Description
ModifyDBInstanceSpec Changes the specifications or storage space of a standalone or replica set instance.