This topic describes how to create a replica set instance in the ApsaraDB for MongoDB console.

Prerequisites

  • An Alibaba Cloud account is registered. For more information, see Sign up with Alibaba Cloud.
  • Your account balance is sufficient if you want to create a pay-as-you-go instance.

Billing

For more information, see Billing items and pricing.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and the region of the target instance.
  3. In the left-side navigation pane, click Replica Set Instances.
  4. On the Replica Set Instances page, click Create Instance.
  5. Click Subscription(Replica Set) or Pay-As-You-Go(Replica Set).
    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.
  6. Configure the instance parameters. The following table describes related parameters.
    Section Parameter Description
    Basic Configuration Region

    The region where the replica set instance is deployed. Only instances in the same region can communicate with each other inside an internal network. After an instance is created, you cannot change its region. Exercise caution when you select the region.

    Instances in the same region (such as an ECS instance and an ApsaraDB for MongoDB instance) can be interconnected with each other over the internal network.

    Zone

    A zone is a geographic area with an independent power supply and network. An ECS instance and an ApsaraDB for MongoDB instance in the same zone can be interconnected over the internal network with the minimum network latency.

    Note To implement zone-disaster recovery, you can deploy the replica set instance across multiple zones. For more information, see Create a multi-zone replica set instance.
    Database Version The version of the database engine for the replica set instance. ApsaraDB for MongoDB supports MongoDB 3.4, 4.0, and 4.2.

    For more information about versions, see MongoDB versions and storage engines.

    Note
    Storage Engine

    The storage engine is WiredTiger.

    Replication Factor Select the number of nodes for the replica set instance based on your business needs. For example, you can select more nodes for business scenarios with more reads than writes.
    Network Type Classic Cloud services in the classic network are not isolated. You can configure security groups or whitelist policies to block unauthorized access to the cloud services.
    VPC A VPC is an isolated network with higher security and performance than the classic network.
    Note
    Specifications Specification
    • The CPU and memory occupied by the instance.
    • The maximum number of connections and maximum IOPS vary depending on different specifications. The maximum IOPS is measured for read and write operations separately, and the maximum sum of read and write operations can be twice the maximum IOPS. For more information, see Instance types.
    Storage Space Each node in the replica set instance has dedicated storage space.
    Note The storage space of a node stores your data, system, and log files.
    Set Password
    • Set Now
    • Set Later

    The password of the root user. You can set a password immediately or reset it during the running of the instance. For more information, see Set a password.

    • The password must contain at least three types of the following characters: uppercase letters, lowercase letters, digits, and special characters. Special characters include #$%^&*()_+-=
    • The password must be 8 to 32 characters in length.
    Quantity Duration
    • Subscription: Select the duration and quantity for the subscription-based instance to be purchased. You can select one to nine months for the subscription period on a monthly basis, or one to three years for the subscription period on a yearly basis.
    • Pay-As-You-Go: Select the quantity for the Pay-As-You-Go instance to be purchased with the same configuration. You can select an integer in the range of 1 to 10.
    Quantity
  7. Click Buy Now to go to the Confirm Order page.
  8. On the Confirm Order page that appears, read and select ApsaraDB for MongoDB Agreement of Service and follow the instructions to complete the payment process.

View the created instance

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the upper-left corner of the page, select the resource group and the region of the target instance.
  3. In the left-side navigation pane, click Replica Set Instances.

Troubleshoot if you cannot find the instance

Possible cause Solution
You selected the wrong region in the console. Select the region where the instance is deployed. For more information, see View created instances.
You opened the incorrect page. In the left-side navigation pane, click Replica Set Instances. For more information, see View created instances.
The instance list in the ApsaraDB for MongoDB console was not updated or was updated before the instance is created. Wait for several minutes and then update the instance list to check whether the instance is added to the list.
Resources are insufficient.

The system may fail to create the instance due to insufficient resources. In this case, your payment is refunded. You can check the refund on the Orders page.

After you confirm the refunded fees, you can try to create the instance in another zone. You can also submit a ticket.

What to do next

After you create an instance, you must configure a whitelist (for more information, see Configure a whitelist for a replica set instance). If you want to connect to the instance over the Internet, you must apply for a public endpoint (for more information, see Apply for a public endpoint for a replica set instance).

For more information about instance connection methods and connection scenarios, see Connect to an ApsaraDB for MongoDB instance.