All Products
Search
Document Center

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

Last Updated:Jul 11, 2024

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

Limits

  • The new storage capacity that you specify must be greater than or equal to the existing storage capacity of the shard nodes.

  • The new number of read-only nodes that you specify must be greater than or equal to the maximum number of read-only nodes among the shard nodes.

  • You cannot increase the number of read-only nodes in a subscription sharded cluster instance that you are downgrading.

Billing rules

For more information, see Configuration change fees.

Usage notes

  • During a configuration change, one or two transient disconnections may occur. Each transient disconnection 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 up the storage capacity on your host without the need for cross-host migrations or failovers. Transient disconnections do not occur during the scale-up process. The scale-up 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 disconnections may occur during the scale-up process. The scale-up 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. Go to the Sharded Cluster Instances page. In the top navigation bar, select the region in which the instance resides. Then, find the instance and click the ID of the instance.

  2. In the Shard List section of the instance details page, select one or more shard nodes based on your business requirements.

    • Change the configuration of a shard node

      Find the shard node whose configurations you want to change and click the 三个点 icon in the Actions column. Then, select Change Configurations for a pay-as-you-go sharded cluster instance or select Upgrade or Downgrade for a subscription sharded cluster instance.

    • Change the configurations of multiple shard nodes

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

      2. In the upper-left corner of the Shard List, click Batch Change Configurations for a pay-as-you-go sharded cluster instance or select Batch Upgrade or Batch Downgrade for a subscription sharded cluster instance.

  3. Configure the parameters described in the following table.

    Parameter

    Description

    Category

    The new category of the shard node.

    Note
    • This parameter is required only for ApsaraDB for MongoDB sharded cluster instances that use cloud disks.

    • If a category is not available for selection, it is not supported in the current zone.

    • For more information about the categories and specifications of ApsaraDB for MongoDB sharded cluster instances, see Sharded cluster instance types.

    Instance Specifications

    The new specifications of the shard node.

    Storage Capacity

    The new storage capacity of the shard node.

    Note
    • The new storage capacity that you specify must be greater than or equal to the existing storage capacity of the shard node. To reduce storage capacity, you can create an instance and then migrate data to the instance. For more information, see Other configuration change scenarios and methods.

    • After you change the Storage Capacity value of the shard node, the new storage capacity that you specify applies to all nodes including read-only nodes in the shard node.

    Read-only Nodes

    The new number of read-only nodes.

    Switching Time

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

    • 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. You can perform the following steps to customize a maintenance window:

      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 up only the storage capacity and the hosts that hold the nodes of the instance have sufficient resources, the scale-up process is executed on the hosts and no cross-host migration or switchover is required. Therefore, the new configurations take effect immediately after the scale-up process is completed, instead of within the specified maintenance window.

  4. 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 applied, the 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

ModifyNodeSpec

Changes the configurations of a mongos or shard node in an ApsaraDB for MongoDB sharded cluster instance.

ModifyNodeSpecBatch

Changes the configurations of multiple mongos or shards nodes in an ApsaraDB for MongoDB sharded cluster instance.