This topic describes how to change the configurations of an existing instance to better meet your needs by using the features provided by ApsaraDB for MongoDB.

Configuration change methods

Configuration change methods and change items vary based on instance architectures. The following table describes the configuration change methods and change items for instances of different architectures.
Configuration change method Billing method Change action Change item
Change the configurations of a standalone instance Subscription Upgrade The Specification and Storage Space configurations of an instance can be changed.
Downgrade The Specification configuration of an instance can be changed.
Pay-as-you-go
  • Upgrade
  • Downgrade
The Specification and Storage Space configurations of an instance can be changed.
Note
  • When you change the value of the Storage Space parameter, you must make sure that the new specified storage space is greater than or equal to the existing storage space of the instance.
  • The storage space of ApsaraDB for MongoDB instances cannot be decreased. To decrease the storage space of an ApsaraDB for MongoDB instance, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
Change the configurations of a replica set instance Subscription Upgrade The Nodes, Specification, and Storage Space configurations of an instance can be changed.
Note
  • The Nodes configuration cannot be changed for instances that run MongoDB 5.0 or 4.4.
  • When you change the value of the Storage Space parameter, you must make sure that the new specified storage space is greater than or equal to the existing storage space of the instance.
Downgrade The Nodes and Specification configurations of an instance can be changed.
Note The Nodes configuration cannot be changed for instances that run MongoDB 5.0 or 4.4.
Pay-as-you-go
  • Upgrade
  • Downgrade
The Nodes, Specification, and Storage Space configurations of an instance can be changed.
Note
  • The Nodes configuration cannot be changed for instances that run MongoDB 5.0 or 4.4.
  • When you change the value of the Storage Capacity parameter, you must make sure that the new specified storage space is greater than or equal to the existing storage space of the instance.
  • The storage space of ApsaraDB for MongoDB instances cannot be decreased. To decrease the storage space of an ApsaraDB for MongoDB instance, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
Overview Subscription 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, you can submit a ticket. To submit a ticket, go to the New Ticket page.
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, you can submit a ticket. To submit a ticket, go to the New Ticket page.
  • 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 shard nodes cannot be decreased. To decrease the storage space of a 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 specified storage space is greater than or equal to the existing storage space of the instance.
  • The storage space of shard nodes cannot be decreased. To decrease the storage space of a shard node, you can create another instance to replace the existing one. For more information, see Other configuration change scenarios and methods.
Pay-as-you-go 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, you can submit a ticket. To submit a ticket, go to the New Ticket page.
Add a shard node When you add a shard node, you can set Instance Specifications, Quantity, and Storage Capacity.
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, you can submit a ticket. To submit a ticket, go to the New Ticket page.
  • When you set the value of the Storage Capacity parameter, you must make sure that the new specified storage space is greater than or equal to the existing storage space of the instance.
  • The storage space of shard nodes cannot be decreased. To decrease the storage space of a 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 and Storage Capacity 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 specified storage space is greater than or equal to the existing storage space of the instance.
  • The storage space of shard nodes cannot be decreased. To decrease the storage space of a 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 You can manually release a mongos or shard node.
Note
  • You can manually release a mongos node for a sharded cluster instance that has at least three mongos nodes, but you must make sure that the sharded cluster instance has at least two mongos nodes after the release.
  • You can manually release a shard node for a sharded cluster instance that has at least three shard nodes, but you must make sure that the sharded cluster instance has at least two shard nodes after the release.
  • 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 such as resetting the password, switching roles, modifying the node connection string, and modifying parameters.

Other configuration change scenarios and methods

You may encounter the following configuration change scenarios:
  • Downgrade the storage space of an instance or a shard node.
  • Add the number of nodes for a standalone instance.
  • Change the architecture of an instance.
  • Change the storage engine from RocksDB or TerarkDB to WiredTiger.
  • Change the instance billing method from subscription to pay-as-you-go.
When you encounter the preceding scenarios, you can use the following methods to change the configurations:
  1. Create an instance. For more information, see Create a standalone instance, Create a replica set instance, or Create a sharded cluster instance.
    Note
    • If you want to decrease the storage space by creating another instance, the storage space of the new instance must be greater than the amount of space used by the source instance.
    • If you want to change the number of nodes by creating another instance, you must create a replica set instance.
    • If you want to change the instance architecture by creating another instance, you must choose the desired instance architecture. For more information about the instance architecture, see Architecture of ApsaraDB for MongoDB.
    • If you want to change the instance billing method from subscription to pay-as-you-go by creating another instance, you must set the billing method of the new instance to pay-as-you-go.
    • In backup and restoration scenarios, you can clone an instance to create another instance. For more information, see Restore backup data to a new ApsaraDB for MongoDB instance by point in time or Restore backup data to a new ApsaraDB for MongoDB instance by backup point.
  2. Migrate the data of the source instance to the new instance. For more information, see Overview.
  3. After you verify functionality of the new instance, switch business from the source instance to the new instance.
  4. Optional:If you no longer need the source instance, release the instance by using one of the following methods:
    • For a subscription instance, you can release the instance by submitting a ticket. To submit a ticket, go to the New Ticket page.
    • For a pay-as-you-go instance, you can manually release the instance. For more information, see Release an instance or a node.

References

For more information about MongoDB versions, storage engines, and the relationship between MongoDB versions and storage engines, see MongoDB versions and storage engines.

For more information about how to upgrade the MongoDB version of an instance, see Upgrade MongoDB versions.