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 within 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 switches services over to another zone.
- You can create multi-zone replica set instances only in some regions. The actually
supported regions are displayed in the console.Note On the instance buy page, you can select a region and view all the zones that support multi-zone deployment within the region in the Zone drop-down list. The name of such a zone contains multiple uppercase letters, as shown in the preceding figure.
- When you create a multi-zone replica set instance, you must set Replication Factor to Three Nodes Replicaset.
Note If you need more nodes after you create an instance, you can change the number of nodes.
Node deployment policies
|Single-zone deployment||The system deploys the primary, secondary, and hidden nodes in one zone.|
|Multi-zone deployment||The system deploys the primary, secondary, and hidden nodes in three zones.|
- Log on to the ApsaraDB for MongoDB console.
- In the left-side navigation pane, click Replica Set Instances.
- On the Replica Set Instances page, click Create Instance.
- Click Replica Set (Subscription) or Replica Set (Pay-as-you-go).Note
- Subscription: You must pay for an instance when you create it. This method is more cost-effective than the pay-as-you-go method. We recommend that you select this method for long-term use. A longer subscription period enables a larger discount.
- Pay-as-you-go: You are billed on an hourly basis based on the used resources. 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.
- Select a region that supports multi-zone deployment and select a zone.
- Configure other parameters. For more information, see Create a replica set instance.
- Click Buy Now to go to the Confirm Order page.
- On the Confirm Order page, read and select ApsaraDB for MongoDB Agreement of Service and complete the payment.
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. This way, your applications can connect to the closest nodes. For more information, see Switch node roles.