This topic describes how to change the configurations of a sharded cluster instance. If the specifications of a sharded cluster instance are higher or lower than required, you can change the configurations of the instance to better suit your business requirements.

Limits

  • The architecture or storage engine of a sharded cluster instance cannot be changed. For example, a sharded cluster instance cannot be changed into a replica set instance.
  • The operations on the nodes of a sharded cluster instance are subject to the following limits.
    Operation Limit
    Add a shard node The specifications of the new shard node must be higher than or equal to the highest specifications among all the shard nodes of the sharded cluster instance.

    For example, if the largest storage space among all the shard nodes of a sharded cluster instance is 10 GB, the storage space of the new shard node must be greater than or equal to 10 GB.

    Change the specifications of a shard node Ensure that the following requirements are met:
    • The storage space that you specify must be greater than or equal to the used storage space on the shard node.
    • The number of read-only nodes that you specify must be greater than or equal to the maximum number of read-only nodes for the shard node of the maximum specifications in the instance.
      Note This limit is applicable to the instances that use the subscription billing method.
    • In a configuration change task, if you want to downgrade the specifications of a shard node, you cannot increase the number of read-only nodes of the instance.
      Note This limit is applicable to the instances that use the subscription billing method.
    Release a mongos node A mongos node can be released for a sharded cluster instance that has at least three mongos nodes.
    Note At least two mongos nodes must be retained for a sharded cluster instance.
    Release a shard node
    • A shard node can be released for a sharded cluster instance that has at least three shard nodes.
      Note At least two shard nodes must be retained for a sharded cluster instance.
    • Before you release a shard node from a sharded cluster instance, make sure that the data of the shard node can be offloaded onto the remaining shard nodes in the sharded cluster instance. Otherwise, the sharded cluster instance stays in the Deleting Node state. In this case, you cannot perform the operations such as resetting the password, switching roles, modifying the node connection string, or modifying parameters.

Billing

For more information, see Configuration change fees.

Precautions

  • During a configuration change, you may experience one or two transient connections. Each transient connection lasts about 30 seconds. To prevent a configuration change from interrupting your workloads, we recommend that you change configurations during off-peak hours.
    Notice If you change only the storage space of an instance, the system performs the corresponding operation based on whether your host has sufficient storage resources.
    • If your host has sufficient storage resources, the system scales out the storage space on your host without the need for cross-host migrations or failovers. Transient connections do not occur during the scale-out process. The scale-out task is immediately executed to completion. You do not need to wait for the maintenance window.
    • If your host does not have sufficient storage resources, cross-host migrations and failovers are required. Transient connections may occur during the scale-out process. The scale-out task is executed during the specified maintenance window.
  • The amount of time required to perform a configuration change depends on factors such as the network conditions, task queue status, and data volume. We recommend that you change the configurations of a sharded cluster instance during off-peak hours and make sure that your application is configured to automatically reconnect to the instance.
  • If the minor version of a sharded cluster instance expires or is not included in the maintenance list, ApsaraDB for MongoDB automatically updates the minor version of the instance to the latest version during a configuration change. This ensures that the sharded cluster instance can provide higher performance and higher stability.

Configuration change operations

Change action Change item
Add a mongos node When you add a mongos node, you can set Instance Specifications and Quantity.
Note A maximum of 32 mongos nodes can be added to each sharded cluster instance. If the sharded cluster instance already has three mongos nodes and you want to add more mongos nodes, you can add a maximum of 29 mongos nodes to the sharded cluster instance. If you need more than 32 mongos nodes in a sharded cluster instance, submit a ticket.
Add a shard node When you add a shard node, you can set Instance Specifications, Quantity, Storage Capacity, and Read-only Nodes.
Note
  • A maximum of 32 shard nodes can be added to each sharded cluster instance. If the sharded cluster instance already has three shard nodes and you want to add more shard nodes, you can add a maximum of 29 shard nodes to the sharded cluster instance. If you need more than 32 shard nodes in a sharded cluster instance, submit a ticket.
  • Read-only Nodes can be specified for subscription instances but not for pay-as-you-go instances.
  • The Instance Specifications, Storage Capacity, and Read-only Nodes values of the added shard node must be greater than or equal to the highest values among existing shard nodes.
  • The storage space of the shard node cannot be decreased. To decrease the storage space of the shard node, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
Change the configurations of one or more mongos nodes The Instance Specifications configurations of one or more mongos nodes can be changed.
Change the configurations of one or more shard nodes The Instance Specifications, Storage Capacity, and Read-only Nodes configurations of one or more shard nodes can be changed.
Note
  • When you change the value of the Storage Capacity parameter, you must make sure that the new storage space that you specify is greater than or equal to the largest storage space among all the shard nodes of the sharded cluster instance.
  • Read-only Nodes can be specified for subscription instances but not for pay-as-you-go instances.
  • If you scale out only the storage space of an instance and your host where the nodes reside has sufficient storage resources, the scale-out task is executed on your host and no cross-host migrations or failovers are required. In this case, the scale-out task is immediately executed to completion. You do not need to wait for the maintenance window.
  • The storage space of the shard node cannot be decreased. To decrease the storage space of the shard node, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
Release a mongos or shard node Mongos or shard nodes can be manually released.
Notice Before you release a shard node from a sharded cluster instance, make sure that the data of the shard node can be offloaded onto the remaining shard nodes in the sharded cluster instance. Otherwise, the sharded cluster instance stays in the Deleting Node state. In this case, you cannot perform operations related to the databases, accounts, and network of the instance.