This topic describes how to change the configurations of a replica set instance. If a purchased replica set instance no longer suits your business requirements, you can change the configurations of the instance.

Billing

For more information, see Configuration change fees.

Limits

  • If your instance has only Classic Network and VPC endpoints, you must apply for a public endpoint or release the classic network endpoint for the instance before you can change the value of the Read-only Nodes parameter.
    Note You can go to the Database Connections page to view the types of networks that are enabled.
  • When you change the configurations of an instance, the storage capacity of the instance cannot be decreased. If you want to decrease the storage capacity of an instance, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
  • When you change the configurations of an instance, the architecture or storage engine of the instance cannot be changed. For example, you cannot change a replica set instance into a sharded cluster one. If you require a different architecture or storage engine, you can create another 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 state, and data volume. We recommend that you change the configurations of an instance during off-peak hours and make sure that your application is configured to automatically reconnect to the instance.
  • If you scale up only the storage capacity of a general-purpose or dedicated instance that uses local disks and resides in a physical device that has sufficient resources, the scale-up is performed on the device without the need for cross-host migration or switchover. As such, the configuration change immediately takes effect regardless of the specified maintenance window and does not cause disconnections.
  • If you scale up only the storage capacity of an instance that uses cloud disks, the configuration change immediately takes effect regardless of the specified maintenance window and does not cause disconnections.
  • During a configuration change, you may experience one or two transient connections. Each transient connection lasts about 30 seconds. Switching Time specifies the time when you want to apply the configuration change. You can set the parameter to an off-peak time period to prevent interruptions to your business.
  • Configuration changes do not cause data loss.
  • If the minor version of an instance expires or is not included in the maintenance list, ApsaraDB for MongoDB automatically updates the minor version of the instance to the latest version when you perform the following operations. This ensures the performance and stability of the instance.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Replica Set Instances.
  3. In the upper-left corner of the page, select the resource group and region to which the instance belongs.
  4. Click the ID of the instance for which you want to change configurations and go to the Basic Information page.
  5. Go to the page on which you can change the configurations of the instance. The available methods to change configurations vary with the billing method of the instance.
    • Subscription

      In the Specifications section, click Upgrade or Downgrade in the upper-left corner of the section.

    • Pay-as-you-go

      In the Specifications section, click Change Configuration in the upper-left corner of the section.

  6. Configure the parameters described in the following table.
    Type Parameter Description
    • Upgrade
    • Downgrade
    Active-standby 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 This parameter cannot be specified if the instance runs MongoDB 4.4 or 5.0.
    Read-only Nodes The number of read-only nodes that can be selected when you change the configurations. Valid values: 0 to 5.

    This parameter cannot be specified if the instance has only Classic Network and VPC endpoints. You can go to the Database Connections page to view the types of networks that are enabled.

    Note This parameter cannot be specified if the instance runs MongoDB 4.4 or 5.0.
    Specifications 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 The storage capacity that can be selected when you change the configurations.
    Note
    • When you change the configurations of an instance, the storage capacity of the instance cannot be decreased. If you want to decrease the storage capacity of an instance, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
    • This parameter specifies the storage capacity of each node rather than the total storage capacity of all nodes.
    Switching Time The time when you want to apply the configuration change.
    • Switch Immediately After Data Migration: ApsaraDB for MongoDB applies the configuration change immediately after you complete configuration change settings.
    • Switch Within Maintenance Window: ApsaraDB for MongoDB applies the configuration change within the maintenance window that you specify. You can use the current maintenance window. You can also re-specify the maintenance window by using one of the following methods:
      1. Click Modify next to Switch Within Maintenance Window.
      2. In the Specification Information section of the Basic Information page, click Edit next to Maintenance Period. For more information, see Specify a maintenance period.
    Note
    • If you scale up only the storage capacity of a general-purpose or dedicated instance that uses local disks and resides in a physical device that has sufficient resources, the scale-up is performed on the device without the need for cross-host migration or switchover. As such, the configuration change immediately takes effect regardless of the specified maintenance window and does not cause disconnections.
    • If you scale up only the storage capacity of an instance that uses cloud disks, the configuration change immediately takes effect regardless of the specified maintenance window and does not cause disconnections.
  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, replica set, or serverless instance.