Updated on 2023-03-15 GMT+08:00

Adding Read Replicas to a Replica Set Instance

Read replicas enhance read capabilities and reduce load on your instances. After a DDS replica set instance is created, you can create read replicas based on service requirements. To connect to a read replica, see Connecting to a Read Replica Using Mongo Shell.

Constraints

  • To use this function, contact customer service to apply for the required permission.
  • The version of a replica set instance must be 3.4, 4.0, or 4.2.
  • Nodes cannot be added to an instance that is being backed up.
  • An instance cannot be deleted when one or more nodes are being added.

Precautions

  • A maximum of five read replicas can be added to a replica set instance.
  • The read replica uses the same specifications as the primary node and automatically synchronizes data from the primary node.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the replica set instance.
  5. In the Node Information area on the Basic Information page, click Add Read Replicas.

    Figure 1 Creating a read replica

  6. On the Add Read Replicas page, specify the number of nodes and delay, and click Next.

    Figure 2 Creating read replicas

  7. On the displayed page, confirm the node configuration information.

    • If you need to modify your settings, click Previous to go back to the page for you to specify details.
    • If you do not need to modify your settings, click Submit to add nodes.

  8. View the results.

    • When nodes are added, the status of the instance is Adding read replicas. The entire process takes about 15 minutes.
    • In the Node Information area, view the information about the nodes you added.
    • Click View Delay in the Operation column to view the delay of the current node.