All Products
Search
Document Center

ApsaraDB for MongoDB:Change the configurations of one or more shard nodes

Last Updated:Mar 18, 2024

If shard nodes cannot meet storage requirements or reach the performance bottleneck, you can change the specifications or storage capacity of the shard nodes to fit your business. This topic describes how to change the configurations (such as specifications and storage capacity) of one or more shard nodes in an ApsaraDB for MongoDB sharded cluster instance.

Limits

Make sure that the following requirements are met:

  • The storage capacity that you specify must be greater than or equal to the used storage capacity on the current shard node.

  • If the billing method of the instance is subscription, the number of read-only nodes that you specify must be greater than or equal to the number of read-only nodes for the shard node with the highest specifications in the instance.

  • In a configuration change task, if you want to downgrade the specifications of the current shard node, you cannot increase the number of read-only nodes of the instance.

Billing rules

For more information, see Configuration change fees.

Usage notes

  • During a configuration change, one or two transient connections may occur. Each transient connection lasts about 30 seconds. To prevent a configuration change from interrupting your workloads, we recommend that you change configurations at a time that has minimal impact on your business.

    Important

    If you change only the storage capacity of an instance, the system performs the corresponding operation based on whether your host has sufficient storage resources.

    • If your host has sufficient storage resources, the system scales out the storage capacity on your host without the need for cross-host migrations or failovers. Transient connections do not occur during the scale-out process. The scale-out task is immediately executed to completion. You do not need to wait for the maintenance window.

    • If your host does not have sufficient storage resources, cross-host migrations and failovers are required. Transient connections may occur during the scale-out process. The scale-out task is executed during the specified maintenance window.

  • The amount of time required to perform a configuration change depends on factors such as the network conditions, task queue status, and data size. We recommend that you change the configurations of a sharded cluster instance during off-peak hours and make sure that your application can automatically reconnect to the instance.

  • If the minor version of a sharded cluster instance expires or is not maintained, ApsaraDB for MongoDB automatically updates the minor version of the instance to the latest version during a configuration change. This ensures that the sharded cluster instance can provide higher performance and higher stability.

Procedure

  1. Log on to the ApsaraDB for MongoDB console .

  2. In the left-side navigation pane, click Sharded Cluster Instances.

  3. In the upper-left corner of the Sharded Cluster Instances page, select the resource group and region to which the desired instance belongs.

  4. Click the ID of the instance or click Manage in the Actions column.

  5. In the Shard List section, select one or more shard nodes.

    Note
    • The new storage capacity that you specify must be greater than or equal to the largest storage capacity among all shard nodes of the sharded cluster instance. If you need to reduce the storage capacity, you can create an instance. For more information, see the "Other configuration change scenarios and methods" section of the Overview topic.

    • After the Storage Capacity configuration of a shard node is changed, the new storage capacity value is applied to the shard node and each read-only node.

    • Change the configurations of a shard node

      Click the 三个点 icon in the Actions column corresponding to the shard node and then select Upgrade or Downgrade.

    • Change the configurations of multiple shard nodes

      1. In the Shard List section of the instance details page, select the shard nodes that you want to manage.

      2. Click Batch Upgrade or Batch Downgrade in the upper-left corner of the Shard List section.

  6. In the Upgrade or Downgrade panel, configure the parameters described in the following table.

    Parameter

    Description

    Instance Specifications

    The new specifications of the shard node.

    Note

    For more information about the specifications supported by shard nodes, see Overview.

    Storage Capacity

    The storage capacity that can be selected when you change the configurations.

    Note
    • The new storage capacity that you specify must be greater than or equal to the largest storage capacity among all shard nodes of the sharded cluster instance. If you need to reduce the storage capacity, you can create an instance. For more information, see the "Other configuration change scenarios and methods" section of the Overview topic.

    • After the Storage Capacity configuration of a shard node is changed, the new storage capacity value is applied to the shard node and each read-only node.

    Read-only Nodes

    The new number of read-only nodes.

    Note

    You can change the value of this parameter if the billing method of the instance is subscription.

    Migration Time

    The time when you want the system to apply the configuration change.

    • Switch Immediately after Migration: ApsaraDB for MongoDB immediately applies the configuration change after you complete the payment.

    • Switch within Maintenance Window: ApsaraDB for MongoDB applies the configuration change within the maintenance window that you specify. You can select the current maintenance window or customize a maintenance window based on your business requirements.

      1. Click Edit next to Switch within Maintenance Window.

      2. In the Specification Information section, click Edit next to Maintenance Period to specify a maintenance window. For more information, see Specify a maintenance window.

    Note

    If you scale out only the storage capacity and the hosts that hold the nodes of the instance have sufficient resources, local scale-out is performed and no data migration or switchover between instances is required. Therefore, the new configurations take effect immediately after the scale-out is completed, instead of within the specified maintenance window.

  7. Perform the corresponding operations based on the selected billing method:
    • Pay-as-you-go: Click Pay Now. Then, the system automatically collects the amount in the next hour.
    • Subscription: Click Pay Now. On the Purchase page, complete the payment process.
    When the configuration change is being performed, the sharded cluster instance is in the Changing Configuration state. After the configuration change is performed, the state of the instance changes to Running.

Related API operations

OperationDescription
ModifyNodeSpecChanges the configurations of a mongos or shard node in an ApsaraDB for MongoDB sharded cluster instance.
ModifyNodeSpecBatchChanges the configurations of multiple mongos or shard nodes in an ApsaraDB for MongoDB sharded cluster instance.