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.

Precautions

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

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Sharding Instances.
  3. On the Sharding Instances page, click Create Instance.
  4. Click Subscription(Sharding) or Pay-As-You-Go(Sharding).
    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. Set region to China (Hangzhou), china (Beijing), China (Shenzhen) or singapore and select the multi-zone in the region.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 ApsaraDB for MongoDB Agreement of Service, and complete the payment as prompted.

References

You can use the Service Availability function to view the distribution of components in a sharded cluster instance across zones. You can also switch the component roles of the instance based on your business deployment. This way, your applications can connect to the components closest to them. For more information, see Switch node roles.