When a shard no longer meets your storage needs or encounters a performance bottleneck, you can change its instance specifications or storage capacity. ApsaraDB for MongoDB sharded cluster instances allow you to change configurations, such as instance specifications and storage capacity, for one or more shards.
Limitations
The selected storage capacity must be greater than or equal to the storage space the shard currently uses.
The selected number of read-only nodes must be greater than or equal to the maximum number of read-only nodes of any shard in the instance.
You cannot increase the number of read-only nodes when you downgrade a subscription instance.
Billing rules
For more information, see Configuration change fees.
Precautions
When you change instance specifications, one or two transient disconnections may occur, each lasting about 30 seconds. You can schedule the switchover time to minimize the impact on your workloads.
ImportantWhen you only change the storage capacity, the impact of the scale-up varies between instances that use cloud disks and instances that use local disks.
For instances that use cloud disks, scaling up storage capacity does not affect your services. No transient disconnection occurs, and the change takes effect immediately.
For instances that use local disks, the system performs different operations based on whether the host has sufficient storage resources. If the host has sufficient resources, the storage is scaled up in-place without a cross-physical-machine migration or switchover. No transient disconnection occurs, and the change takes effect immediately. If the host has insufficient resources, a cross-physical-machine migration and switchover are required. A transient disconnection occurs, and the change takes effect during the switchover time that you specify.
The duration of a configuration change depends on several factors, such as network conditions, the task queue, and the amount of data. We recommend that you perform this operation during off-peak hours and ensure that your application has an automatic reconnection mechanism.
If your database runs an outdated minor version that is no longer maintained, the system automatically upgrades it to the latest version during the configuration change to ensure better performance and stability.
-
Local disk instance modifications take significantly longer than cloud disk modifications, which typically complete within one hour.
Procedure
Go to the ApsaraDB for MongoDB sharded cluster instances page. In the top navigation bar, select a resource group and a region. Then, click the ID of the target instance.
In the Shard List section, change the configurations of the desired shards.
Change configurations for 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 configuration. For a subscription instance, select Upgrade or Downgrade as needed.Change configurations for multiple shards
In the Shard List section, select the target shards.
In the upper-left corner of the Shard List section, click Batch Reconfigure for pay-as-you-go instances. For subscription instances, click Batch Upgrade or Batch Downgrade as needed.
Set the following parameters.
Parameter
Description
Category
Select the instance specification category for the shard.
Note-
Available only for cloud disk-based instances.
-
A category is unavailable if the current zone does not support it.
-
For information about the categories and specifications of sharded cluster instances, see Sharded cluster instance specifications.
Instance Specifications
Select the instance specifications for the shard.
Storage Capacity
Select the new storage capacity for the shard.
NoteThe new storage capacity must be greater than or equal to the shard's current capacity. To decrease storage capacity, you must create a new instance. For more information, see Solutions for other configuration change scenarios.
After you change the Storage Space of a shard, the new storage capacity applies to all nodes within the shard, including read-only nodes.
Read-only Nodes
Select the number of read-only nodes after the configuration change.
Switchover Time
Select when the configuration change takes effect.
Switch Immediately after Migration: The change is applied as soon as the task completes.
Switch within Maintenance Window: The system applies the change within the specified maintenance window. You can use the current maintenance window or set a new one.
Click Switch within Maintenance Window next to Edit to set the switchover time.
In the Specification Information section, click Maintenance Window next to Edit to set the switchover time. For more information, see Set a maintenance window.
NoteIf you only scale up the storage capacity and the host of each shard has sufficient resources, the storage is scaled up in-place without a cross-physical-machine migration or switchover. In this case, the change takes effect immediately, rather than waiting for the maintenance window.
-
-
Complete the purchase based on your billing method.
-
For pay-as-you-go instances: Click Pay. The system automatically deducts the fee within the next hour.
-
For subscription instances: Click Pay, and then follow the instructions on the Pay page to complete the payment.
During the configuration change, the instance status is In the process of matching. The change is complete when the instance status changes to Running.
-
Related APIs
|
API |
Description |
|
Modifies the specifications of a single Mongos node or shard in an ApsaraDB for MongoDB sharded cluster instance. |
|
|
Modifies the specifications of multiple Mongos nodes or shards in an ApsaraDB for MongoDB sharded cluster instance. |