This topic describes how to create a multi-zone replica set instance. ApsaraDB for MongoDB provides a zone-disaster recovery solution to ensure the reliability and availability of your replica set instance. This solution deploys the nodes of a three-node replica set instance to three different zones in one region. The nodes in these zones exchange data over an internal network. When one of the three zones becomes unavailable due to unexpected events such as a power or network failure, the high availability (HA) system automatically switches over services to another zone.

Notes

  • You can only create a multi-zone replica set instance in China (Hangzhou), China (Beijing), China (Shenzhen), and Singapore.
  • When you create a multi-zone replica set instance, you must set Replication Factor to Three Nodes Replicaset.
    Note If you need more nodes, you can change the number of nodes after you create the instance.

Node deployment policies

Deployment Description
Single-zone deployment The system deploys the primary, secondary, and hidden nodes in one zone.Single-zone deployment
Multi-zone deployment The system deploys the primary, secondary, and hidden nodes in three different zones.Multi-zone deployment

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Replica Set Instances.
  3. On the Replica Set Instances page, click Create Instance.
  4. Click Subscription(Replica Set) or Pay-As-You-Go(Replica Set).
    Note
    • Subscription: You must pay for the subscription when you create an instance. We recommend that you select this billing method for long-term use, because it is more cost-effective than pay-as-you-go billing. Longer subscription periods have larger discounts.
    • Pay-as-you-go: A pay-as-you-go instance is charged at an hourly rate based on your actual resource usage. We recommend that you select this billing method for short-term use. You can reduce costs by releasing your pay-as-you-go instance after you no longer need it.
  5. On the Create Instance page, set Region to China (Hangzhou), China (Beijing),China (Shenzhen), or Singapore. Then select a multi-zone from the Zone drop-down list.
  6. Configure other parameters. For more information, see Create a replica set instance.
  7. Click Buy Now. The Confirm Order page appears.
  8. Read and select Agreement of Service, and complete the payment as prompted.

References

You can use the Service Availability feature to view the distribution of nodes in a replica set instance across zones. You can also switch the node roles of the instance based on your business deployment. Then your applications can connect to the nodes closest to them. For more information, see Switch node roles.