To meet data reading performance requirements in various business scenarios, the number of primary and secondary nodes in a replica set instance can be changed in ApsaraDB for MongoDB. Data can be read from added secondary nodes. This method improves the overall read performance of replica set instances.
You can add or remove nodes for a replica set instance, which must have at least three nodes. Changing the number of nodes for a replica set instance results in a change to its bill. For more information, see Billing items and pricing.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the resource group and the region of the target instance.
- In the left-side navigation pane, click Replica Set Instances.
- Find the target instance and click its ID.
- On the Basic Information page, perform the following steps based on the billing method of the instance:
- For a pay-as-you-go instance, click Upgrade or Downgrade in the Basic Information section.
- For a pay-as-you-go instance, click Change Configuration in the Basic Information section.
- On the Change Configuration page, specify Replication Factor.
- Read and select ApsaraDB for MongoDB Agreement of Service and complete the payment.
What to do next
After you add the nodes for the replica set instances, the connection strings of new nodes (all displayed as Secondary but with different role IDs) appear in the console. The connection string URI for a high availability connection is also updated. You can modify the connection string in an application to achieve high availability and read/write splitting connection and improve the overall performance. For more information, see Overview of replica set instance connections.