Create a DynamoDB-compatible ApsaraDB for MongoDB instance

更新时间:
复制 MD 格式
Important

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

Create the instance

  1. Log on to the ApsaraDB for MongoDB console.

  2. In the left navigation pane, click Sharded Cluster Instances.

  3. On the Sharded Cluster Instances page, click Create Instance.

  4. Set Product Type to Sharded Cluster (Subscription) or Sharded Cluster (Pay-as-you-go).

  5. Configure the following parameters. Fixed parameters (cannot be changed)

    Required parameters

    ParameterRequiredDescription
    RegionYesThe 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.
    ZoneYesThe 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 typeYesSelect DynamoDB. For compatibility details, see Compatibility details of DynamoDB-compatible ApsaraDB for MongoDB instances.
    Engine versionYesSelect MongoDB 4.0.
    Storage engineYesFixed 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.

    Note

    By configuring resource groups, you can centrally manage multiple regions and various cloud resources under a single Alibaba Cloud account.

    Network typeYesSelect VPC. VPC provides better security and performance than classic network.
    VPCYesThe 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.
    vSwitchYesThe vSwitch in the selected VPC. If none exists, create one in the VPC console. See Create and manage a vSwitch.
    Mongos specificationYesThe specifications of the mongos nodes. For available specs, see Instance specifications. You can change these after the instance is running.
    Mongos quantityYesThe 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 specificationsYesThe specifications of the shard nodes. For available specs, see Instance specifications. You can change these after the instance is running.
    Shard storageYesThe storage capacity per shard node (not the total). Each node stores data files, system files, and log files.
    Shard quantityYesThe 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 passwordNoSet 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.
    ParameterValue
    Configserver specification1 vCore, 2 GB memory
    ConfigServer storage20 GB

    Subscription-only parameters

    ParameterRequiredDescription
    Number of read-only nodesNoThe number of read-only nodes. For details, see Read-only nodes.
    DurationYesThe 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.
  6. Complete the purchase based on the billing method.

    Billing methodSteps
    SubscriptionClick 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-goClick 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.
  7. Verify that the instance was created successfully.

    1. After payment, click Console to return to the ApsaraDB for MongoDB console.

    2. In the upper-left corner, select the resource group and region of the instance.

    3. In the left navigation pane, click Sharded Cluster Instances.

    4. 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 causeSolution
    Incorrect region selectedIn the upper-left corner of the console, select the region where you created the instance.
    Wrong instance listIn the left navigation pane, select Sharded Cluster Instances.
    Insufficient resourcesThe 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.

  1. After configuring parameters, click Add To Cart.

  2. Click the Cart icon on the right side of the page.

  3. In the Cart panel, select the products to purchase and click Proceed To Checkout.

  4. On the Cart page, confirm your selection. If needed, adjust the Duration or Quantity for the instance.

  5. Click Buy Now.

  6. On the Confirm Order page, accept the Terms of Service and click Confirm Purchase.

  7. Complete payment on the Purchase page.

API reference

OperationDescription
CreateShardingDBInstanceCreates or clones an ApsaraDB for MongoDB sharded cluster instance.
DescribeInstanceAutoRenewalAttributeQueries whether auto-renewal is enabled for an instance.
DescribeDBInstanceAttributeQueries the details of an instance.

What's next

After the instance is created:

  1. Set a password (if not set during creation): See (Optional) Reset a password.

  2. Configure an IP whitelist: Allow specific IP addresses or CIDR blocks to access the instance. See Configure a whitelist for an instance.

  3. (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.