If a shard has insufficient storage or reaches a performance bottleneck, you can change its specifications or storage space. With ApsaraDB for MongoDB sharded cluster instances, you can apply this configuration change to one or more shards.
Limits
The storage space that you select must be greater than or equal to the storage space that is currently used by the shard.
The number of read-only nodes that you select must be greater than or equal to the maximum number of read-only nodes among the shards.
When you downgrade a subscription instance, you cannot increase the number of read-only nodes.
Billing rules
For more information, see Configuration change fees.
Precautions
During the configuration change, one or two transient disconnections may occur. Each disconnection lasts for about 30 seconds. To avoid business interruptions, set the effective time for the change.
ImportantIf you change only the storage space, the system performs different operations based on the available storage resources on the local host.
Sufficient: The storage is scaled out on the local host without a cross-host migration or switchover. No transient disconnection occurs during this process. The task is executed immediately and you do not need to wait for the maintenance window.
Insufficient: A cross-host migration and switchover are required. A transient disconnection occurs during this process. The task takes effect within the effective time that you set.
The time required to complete a configuration change depends on factors such as the network, the task queue, and the data size. We recommend that you change the configuration during off-peak hours and ensure that your application has an automatic reconnection mechanism.
If the minor version of your database is expired or no longer maintained, the system automatically upgrades the minor version to the latest version to ensure better performance and stability.
Changing the configuration of an instance with local disks takes a long time. In contrast, changing the configuration of an instance with cloud disks is faster and is usually completed within one hour. This makes cloud disks suitable for scenarios that are sensitive to the specification change duration.
Procedure
Go to the MongoDB sharded cluster instances page. At the top of the page, select a resource group and a region. Then, click the ID of the target instance.
In the Shard List section, change the configuration of one or more shards as needed.
Change the configuration of a single shard
Click the
icon in the Actions column of the target shard. Then, for a pay-as-you-go instance, select Change Configuration. For a subscription instance, select Upgrade Configuration or Downgrade Configuration.Change the configuration of multiple shards
In the Shard List section, select the target shards.
In the upper-left corner of the Shard List, select Batch Change Configurations for a pay-as-you-go instance. For a subscription instance, select Batch Upgrade or Batch Downgrade as needed.
Set the following parameters.
Parameter
Description
Specification Category
Select the specification category of the shard.
NoteThis parameter applies only to instances that use cloud disks.
If a category is not supported in the current zone, you cannot select that category.
For more information about the categories and specifications of sharded cluster instances, see Sharded cluster instance types.
Instance Specifications
Select the specifications of the shard.
Storage Capacity
Select the new storage space for the shard.
NoteThe selected storage space must be greater than or equal to the current storage space of the corresponding shard. To decrease the storage space, you can create a new instance. For more information, see Other configuration change scenarios and solutions.
After you change the Storage Capacity value of the shard, the new storage capacity that you specify applies to all nodes in the shard, including read-only nodes in the shard.
Read-only Nodes
Select the number of read-only nodes for the configuration change.
Switchover Time
Select the time when the configuration change takes effect.
Switch Immediately after Migration: After the configuration change is complete, the system immediately performs the switchover.
Switch within Maintenance Window: The switchover takes effect within the maintenance window. You can select the currently set maintenance window or set a new one as needed.
Click Edit to the right of Switch within Maintenance Window to set the switchover time.
In the Specification Information section, click Edit to the right of Maintenance Window to set the switchover time. For more information about how to set the time, see Set a maintenance window.
NoteIf you only scale out the storage space and the host of each shard has sufficient resources, the storage is scaled out locally without cross-host migration or switchover. Therefore, the task is executed and takes effect immediately. You do not need to wait for the maintenance window.
Complete the purchase based on the billing method.
Pay-as-you-go: Click Pay Now. The system automatically deducts the fee within the next hour.
Subscription: Click Pay Now and complete the payment process on the Payment page.
During the configuration change, the instance status is Changing Configuration. When the instance status changes to Running, the configuration change is complete.
Related API operations
API | Description |
Changes the configuration of a single Mongos or shard node in an ApsaraDB for MongoDB sharded cluster instance. | |
Changes the configurations of multiple Mongos or shard nodes in an ApsaraDB for MongoDB sharded cluster instance. |