Release mongos or shard nodes from a sharded cluster instance to reduce costs during off-peak hours or when nodes are underutilized.
Prerequisites
Before you begin, ensure that you have:
A sharded cluster instance with nodes eligible for release
(For shard nodes) The ApsaraDB for MongoDB balancer enabled. For details, see Manage the ApsaraDB for MongoDB balancer
(For shard nodes) Confirmed that the remaining shard nodes have enough storage space to absorb the migrated data
(For shard nodes) Deleted any orphaned documents. For details, see the "Preparations" section in Configure one-way data synchronization between ApsaraDB for MongoDB instances (sharded cluster architecture)
Usage notes
General:
The instance enters the Deleting Node state during the release process. Password resets, endpoint modifications, and parameter changes are unavailable in this state.
Release nodes during off-peak hours to minimize impact.
Confirm the node is no longer needed before releasing it.
Mongos nodes:
An instance must have at least two mongos nodes. If the instance has only two mongos nodes, neither can be released.
Shard nodes:
The following factors affect how long the release takes: the amount of data on the shard node, balancing windows, and jumbo chunks. For details, see Balancing Windows and Jumbo Chunks.
When a shard node is released, its data migrates to the remaining shard nodes. If the remaining nodes run out of storage space, the instance is automatically locked to prevent data loss.
If a
duplicated keyerror occurs during data migration, check whether records with the same unique index field value exist. For example, different shard nodes may store two documents with different shard keys but the same primary key. Theduplicated keyerror is returned when orphaned documents exist in the database. Delete orphaned documents before releasing the shard node.
Billing
Releasing a node is a configuration change and incurs fees. For details, see Configuration change fees.
Release a mongos or shard node
Log on to the ApsaraDB for MongoDB console.
In the left-side navigation pane, click Sharded Cluster Instances.
In the upper-left corner, select the resource group and region of the instance.
Click the instance ID, or click Manage in the Actions column.
On the instance details page, release the target node based on its type:
Release a mongos node: In the Mongos List section, find the node and click the
icon in the Actions column. Select Release.Release a shard node: In the Shard List section, find the node and click the
icon in the Actions column. Select Release.Make sure the remaining shard nodes have enough storage space before proceeding.
When the shard node is released, its data migrates to the remaining nodes. If any remaining node runs out of space, the instance is automatically locked to prevent data loss.
In the Release Node message, click OK.
The instance enters the Deleting Node state.