This topic describes how to create a multi-zone sharded cluster instance. ApsaraDB for MongoDB provides a zone-disaster recovery solution to ensure the reliability and availability of your sharded cluster instance. This solution deploys the components of a sharded cluster instance across three different zones within one region. The components 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 services over to another zone.
You can create multi-zone sharded cluster instances only in some regions. The actually supported regions are displayed in the console.
Node deployment policies
If you use the single-zone deployment solution, the system deploys all components of the sharded cluster instance to one zone. If you use the multi-zone deployment solution, the system deploys all components to three different zones.
- mongos is evenly deployed across all data centers. At least two mongos are deployed at a time, with each to one zone. When you add a third mongos, the system deploys it to the third zone. Each new mongos added later is deployed to one of the three zones in turn.
- The primary, secondary, and hidden shards in each shard are not deployed to the three zones in sequence. The deployment of these shards may change when manual switchover or HA failover between primary and secondary shards is triggered.
- Log on to the ApsaraDB for MongoDB console.
- In the left-side navigation pane, click Sharded Cluster Instances.
- On the Sharded Cluster Instances page, click Create Instance.
- Click Sharded Cluster (Pay-as-you-go) or Sharded Cluster (Subscription).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 sharded cluster 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 sharded cluster 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.