DynamoDB-compatible sharded cluster instances are no longer available for purchase. To use sharded cluster instances, use the MongoDB protocol instead. For more information, see [Notice] End of sale for DynamoDB-compatible sharded cluster instances.
ApsaraDB for MongoDB sharded cluster instances support the DynamoDB protocol. This topic describes how to create a DynamoDB-compatible sharded cluster instance in the console.
Prerequisites
Before you begin, make sure that you have:
An Alibaba Cloud account. To create one, see Sign up with Alibaba Cloud
Sufficient account balance (required for pay-as-you-go instances only)
A Virtual Private Cloud (VPC) in the target region. If none exists, see Create and manage a VPC
If your application runs on an Elastic Compute Service (ECS) instance: the ECS instance is in the same region and uses the same VPC as the MongoDB instance you plan to create
Limits
Only sharded cluster instances running MongoDB 4.0 are compatible with the DynamoDB protocol.
If your ECS instance uses the classic network, migrate it to a VPC before creating the MongoDB instance. See Migrate ECS instances from the classic network to a VPC.
Create the instance
Log on to the ApsaraDB for MongoDB console.
In the left navigation pane, click Sharded Cluster Instances.
On the Sharded Cluster Instances page, click Create Instance.
Set Product Type to Sharded Cluster (Subscription) or Sharded Cluster (Pay-as-you-go).
Configure the following parameters. Fixed parameters (cannot be changed)
Required parameters
Parameter Required Description Region Yes The region where the instance is deployed. The region cannot be changed after the instance is created. If your application is on an ECS instance, select the same region — instances in different regions cannot communicate over an internal network. Zone Yes The zone where the instance is deployed. Select the same zone as your ECS instance to minimize latency. If you select a different zone, you can migrate the instance to the same zone as your ECS instance after creation. See Migrate an ApsaraDB for MongoDB instance to a different zone. For zone-disaster recovery, select multi-zone deployment. See Create a multi-zone sharded cluster instance. Protocol type Yes Select DynamoDB. For compatibility details, see Compatibility details of DynamoDB-compatible ApsaraDB for MongoDB instances. Engine version Yes Select MongoDB 4.0. Storage engine Yes Fixed to WiredTiger. Resource Group
Select the resource group to which the instance belongs. You can select an existing resource group or create a resource group. For more information about how to create a resource group, see Create a resource group.
NoteBy configuring resource groups, you can centrally manage multiple regions and various cloud resources under a single Alibaba Cloud account.
Network type Yes Select VPC. VPC provides better security and performance than classic network. VPC Yes The VPC where the instance is deployed. If your application is on an ECS instance, select the same VPC. To switch VPCs after creation, see Switch the network type of an ApsaraDB for MongoDB instance. You can also connect your data center to Alibaba Cloud VPC resources over a leased line or VPN. See Configure a hybrid access solution to switch the network type of an ApsaraDB for MongoDB instance from classic network to VPC. vSwitch Yes The vSwitch in the selected VPC. If none exists, create one in the VPC console. See Create and manage a vSwitch. Mongos specification Yes The specifications of the mongos nodes. For available specs, see Instance specifications. You can change these after the instance is running. Mongos quantity Yes The number of mongos nodes. Valid values: 2–32. By default, mongos nodes use a standalone architecture. Select at least 2 nodes for high availability. Shard specifications Yes The specifications of the shard nodes. For available specs, see Instance specifications. You can change these after the instance is running. Shard storage Yes The storage capacity per shard node (not the total). Each node stores data files, system files, and log files. Shard quantity Yes The number of shard nodes. Valid values: 2–32. Shard nodes use a three-node replica set architecture. Select at least 2 shard nodes for proper sharding. See Configure sharding to maximize the performance of shards. Set password No Set the password for the root account now or after creation. If you choose Set Now, the password must be 8–32 characters and contain at least 3 of the following character types: uppercase letters, lowercase letters, digits, and special characters ( !@#$%^&*()_+-=). To set the password after creation, see (Optional) Reset a password.Parameter Value Configserver specification 1 vCore, 2 GB memory ConfigServer storage 20 GB Subscription-only parameters
Parameter Required Description Number of read-only nodes No The number of read-only nodes. For details, see Read-only nodes. Duration Yes The subscription duration. Monthly: 1–9 months. Yearly: 1–5 years. To enable auto-renewal, select Auto-renewal and make sure your account balance is sufficient. Complete the purchase based on the billing method.
Billing method Steps Subscription Click Buy Now. On the Confirm Order page, verify the parameters and accept the Terms of Service. Click Pay and complete payment. To pay for multiple orders at once, click Add To Cart instead — see Pay for orders in the cart. Pay-as-you-go Click Buy Now. On the Confirm Order page, verify the parameters and accept the Terms of Service. Click Activate Now. The system deducts charges within the next hour. Verify that the instance was created successfully.
After payment, click Console to return to the ApsaraDB for MongoDB console.
In the upper-left corner, select the resource group and region of the instance.
In the left navigation pane, click Sharded Cluster Instances.
Check whether the instance appears in the list.
If the instance appears and its status is Running, it was created successfully.
If the instance does not appear, wait 10–15 minutes and refresh the page. If it still does not appear, check the table below.
Possible cause Solution Incorrect region selected In the upper-left corner of the console, select the region where you created the instance. Wrong instance list In the left navigation pane, select Sharded Cluster Instances. Insufficient resources The instance was not created and your payment was refunded. Try creating the instance in a different zone.
Pay for orders in the cart
For subscription instances, you can add them to the cart and pay in a single transaction.
After configuring parameters, click Add To Cart.
Click the Cart icon on the right side of the page.
In the Cart panel, select the products to purchase and click Proceed To Checkout.
On the Cart page, confirm your selection. If needed, adjust the Duration or Quantity for the instance.
Click Buy Now.
On the Confirm Order page, accept the Terms of Service and click Confirm Purchase.
Complete payment on the Purchase page.
API reference
| Operation | Description |
|---|---|
| CreateShardingDBInstance | Creates or clones an ApsaraDB for MongoDB sharded cluster instance. |
| DescribeInstanceAutoRenewalAttribute | Queries whether auto-renewal is enabled for an instance. |
| DescribeDBInstanceAttribute | Queries the details of an instance. |
What's next
After the instance is created:
Set a password (if not set during creation): See (Optional) Reset a password.
Configure an IP whitelist: Allow specific IP addresses or CIDR blocks to access the instance. See Configure a whitelist for an instance.
(Optional) Apply for a public endpoint: Required if you need to connect to the instance over the Internet. See (Optional) Apply for a public endpoint for an instance.