All Products
Search
Document Center

ApsaraDB for MongoDB:Release a mongos or shard node

Last Updated:Feb 26, 2024

This topic describes how to release a mongos or shard node of a sharded cluster instance.

Usage notes

  • When you release a node from an instance, the instance is in the Deleting Node state. In this case, you cannot reset the password, modify the endpoint of the node, or modify parameters. We recommend that you release a node from an instance during off-peak hours.

  • Make sure that the node to be released is no longer needed.

  • If an instance contains only two mongos nodes, the nodes cannot be released from the instance.

  • To release a shard node from an instance, take note of the following items:

    • Before you release a shard node, make sure that the ApsaraDB for MongoDB balancer is enabled. For more information, see Manage the ApsaraDB for MongoDB balancer.

    • The following factors affect the actual time consumed to release the node: the amount of data on the shard node, balancing windows, and jumbo chunks.

      Note

      For more information about balancing windows and jumbo chunks, see Balancing Windows and Jumbo Chunks.

    • Make sure that the remaining shard nodes have sufficient storage space.

      When the shard node is released, the data on the shard node is migrated to the remaining shard nodes. If the storage space of the remaining shard nodes is full, the instance is automatically locked to avoid data loss.

    • If the duplicated key error is reported when the data on the shard node is migrated to the remaining shard nodes, 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.

      Note

      The duplicated key error is returned when orphaned documents exist in the database. We recommend that you delete the orphaned documents before you release the shard node. For more information, see the "Preparations" section of the Configure one-way data synchronization between ApsaraDB for MongoDB instances (sharded cluster architecture) topic.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the left-side navigation pane, click Sharded Cluster Instances.

  3. In the upper-left corner of the page that appears, select the resource group and region to which the desired instance belongs.

  4. Click the ID of the instance that you want to manage or click Manage in the Actions column.

  5. Perform one of the following operations based on the type of the node that you want to release:

    • Release a mongos node

      In the Mongos List section of the instance details page, find the node that you want to release and click the 更多 icon in the Actions column. Then, select Release.

    • Release a shard node

      Important

      Before you release a shard node, make sure that the remaining shard nodes have sufficient storage space.

      When the shard node is released, the data on the shard node is migrated to the remaining shard nodes. If the storage space of the remaining shard nodes is full, the instance is automatically locked to avoid data loss.

      In the Shard List section of the instance details page, find the node that you want to release and click the 更多 icon in the Actions column. Then, select Release.

  6. In the Release Node message, click OK.

    When you release a node from an instance, the instance is in the Deleting Node state.