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 in 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 over services to another zone.


You can only create a multi-zone sharded cluster instance in China (Hangzhou), China (Beijing), China (Shenzhen), and Singapore.

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.
Figure 1. Deployment policy for the components in a multi-zone sharded cluster instance


  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Sharded Cluster Instances.
  3. On the Sharded Cluster Instances page, click Create Instance.
  4. Click Subscription(Sharding) or Pay-As-You-Go(Sharding).
    • 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.
    Select multiple zones to create a sharded cluster instance
  6. Configure other parameters. For more information, see Create a sharded cluster instance.
  7. Click Buy Now. The Confirm Order page appears.
  8. Read and select Agreement of Service and complete the payment.


You can use the Service Availability function 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 nodes closest to them. For more information, see Switch node roles.