If a shard has insufficient storage or a performance bottleneck, you can change its specifications or storage capacity.ApsaraDB for MongoDB sharded cluster instances let you change these configurations for one or more shards.
Limitations
-
The selected storage capacity must be greater than or equal to the shard's current storage usage.
-
The selected number of read-only nodes must be greater than or equal to the maximum number of read-only nodes among all shards in the instance.
-
You cannot increase the number of read-only nodes when you downgrade a subscription instance.
Billing
For more information, see Configuration change fees.
Usage notes
-
When you change specifications, one or two transient disconnections may occur, each lasting about 30 seconds. You can schedule the change to take effect at a specific time to avoid service interruptions.
ImportantWhen you change only the storage capacity, the impact of the scale-out operation varies between instances that use cloud disks and instances that use local disks.
-
Instances that use cloud disks: Scaling out storage capacity does not affect your services. No transient disconnection occurs, and the task is executed and takes effect immediately.
-
Instances that use local disks: The system's behavior depends on whether the host has sufficient storage resources. If resources are sufficient, the storage is scaled out on the local host without a cross-host migration or switchover. No transient disconnection occurs, and the change takes effect immediately. If resources are insufficient, a cross-host migration and switchover are required. A transient disconnection occurs, and the switchover takes effect within the specified maintenance window.
-
-
The time required to complete a configuration change depends on several factors, including network conditions, the task queue, and the amount of data. Perform configuration changes during off-peak hours and ensure your application has an automatic reconnection mechanism.
-
If the minor version of your database is outdated or no longer maintained, the system, by default, upgrades it to the latest version to ensure better performance and stability.
Configuration changes for instances that use local disks take longer than for instances that use cloud disks. For cloud disk instances, the change typically completes within one hour, making them suitable for time-sensitive scenarios.
Procedure
-
Go to the Sharded Cluster Instances page. At the top of the page, select a resource group and region, and then click the ID of the target instance.
-
In the Shard List section, change the configuration of one or more shards as needed.
-
To change the configuration of a single shard
In the row of the target shard, click the
icon in the Actions column. For a pay-as-you-go instance, select Change Configurations. For a subscription instance, select Upgrade or Downgrade as needed. -
To change the configurations of multiple shards
-
In the Shard List section, select the target shards.
-
In the upper-left corner of the Shard List section, 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
Category
Select a category for the shard.
NoteThis parameter is available only for instances that use cloud disks.
If an instance category is not supported in the current availability zone, you cannot select it.
For information about the instance categories and specifications of sharded cluster instances, see Sharded cluster instance types.
Instance Specifications
Select the specifications for the shard.
Storage Capacity
Select the new storage capacity for the shard.
Note-
The selected storage capacity must be greater than or equal to the current storage capacity of the shard. To reduce storage capacity, create a new instance and migrate data to it. For more information, see Other configuration change scenarios and solutions.
-
After you change the Storage Capacity of a shard, the new capacity applies to all nodes in the shard, including its read-only nodes.
Read-only Nodes
Select the number of read-only nodes.
Switchover Time
Select when the configuration change takes effect.
-
Switch Immediately after Migration: The system applies the configuration change immediately after the task is complete.
-
Switch within Maintenance Window: The configuration change takes effect within the specified maintenance window. You can use the current maintenance window or configure a new one based on your business requirements.
-
Click Edit next to Switch within Maintenance Window to set the switchover time.
-
In the Specification Information section, click Edit next to Maintenance Period to set the switchover time. For more information, see Set a maintenance window.
-
NoteIf you only scale up the storage capacity and the hosts where the shards reside have sufficient resources, the storage is scaled out on the local hosts. No cross-host migration or switchover is required. In this case, the task is executed and takes effect immediately, not within the maintenance window.
Complete the purchase based on the billing method.
Pay-as-you-go: Click Go to Pay. The system automatically deducts the fee in the next hour.
Subscription: Click Go to Pay and follow the instructions on the Payment page to complete the payment.
While the configuration change is in progress, the instance status is Modifying. The change is successful when the status changes to Running.
API reference
| API | Description |
|---|---|
| ModifyNodeSpec | Changes the configuration of a single Mongos or shard node. |
| ModifyNodeSpecBatch | Changes the configurations of multiple Mongos or shard nodes. |