ApsaraDB for MongoDB provides replica set instances that are suitable for scenarios in which the number of read operations is larger than the number of write operations or the number of operations surges due to impromptu events. These scenarios are common in websites that provide online reading services and in systems that provide order queries. This topic describes how to create a replica set instance in the ApsaraDB for MongoDB console.
Prerequisites
Precautions
If your application is deployed on an Elastic Compute Service (ECS) instance, make sure that your ApsaraDB for MongoDB instance and ECS instance meet the following requirements to ensure network connectivity: For more information about how to view ECS instance information, see View instance information.- Your ApsaraDB for MongoDB instance and ECS instance are deployed in the same region, and preferably belong to the same zone. This reduces network latency.
- Your ApsaraDB for MongoDB instance and ECS instance use the same network type.
Note
- VPC is recommended because VPC provides higher security.
- If the network type is VPC, you must ensure that they use the same VPC ID.
- If you want to use VPC, but the network type of the ECS instance is classic network, you can change the network type of the ECS instance to VPC. For more information, see Migrate ECS instances from the classic network to a VPC.
Limits
Region | Zone |
---|---|
China (Hangzhou) | Hangzhou Zone G, H, or I |
China (Shanghai) | Shanghai Zone B or G |
China (Qingdao) | Qingdao Zone C |
China (Beijing) | Beijing Zone F or H |
China (Zhangjiakou) | Zhangjiakou Zone A or C |
China (Hohhot) | Hohhot Zone B |
China (Shenzhen) | Shenzhen Zone E |
China (Heyuan) | Heyuan Zone A or B |
China (Chengdu) | Chengdu Zone A or B |
Singapore (Singapore) | Singapore Zone A, B, or C |
US (Silicon Valley) | Silicon Valley Zone B |
US (Virginia) | Virginia Zone A or B |
Billing
- Subscription: If you purchase a subscription instance, you must pay an upfront fee for the instance.
- Pay-as-you-go: A pay-as-you-go instance is charged per hour based on the configurations of the instance. Fees are automatically deducted from your Alibaba Cloud account.
For more information, see Billable items and pricing.
Procedure
After you perform the following steps, ApsaraDB for MongoDB automatically creates one or more standalone instances. No manual interventions are required.
Pay for orders in the cart
- In the lower-right corner of the page, click the Cart icon.
- In the Cart panel, select the orders that you want to pay and click Proceed to Checkout.
- On the Cart page, check whether the orders that you want to pay are selected.
Note You can also re-specify the Subscription Cycle and Quantity values.
- If the orders that you want to pay are selected, click Buy Now.
- If the orders that you want to pay are not selected, select the orders and click Buy Now.
- On the Confirm Order page, read ApsaraDB for MongoDB (Subscription) Service Agreement, select I have read and agreed to the terms, and then click Confirm Purchase.
- On the Purchase page, complete the payment.
Related API operations
Operation | Description |
---|---|
CreateDBInstance |
|
DescribeInstanceAutoRenewalAttribute | Queries whether auto-renewal is enabled for an ApsaraDB for MongoDB instance. |
DescribeDBInstanceAttribute | Queries the detailed information of an ApsaraDB for MongoDB instance. |
What to do next
- Optional:If you did not set the password of the root account for the replica set instance when you created the instance, set the password of the root account. For more information, see (Optional) Reset a password.
- Configure IP address whitelists for the replica set instance to allow the IP addresses or CIDR blocks in the whitelists to access the instance. For more information, see Configure a whitelist for an ApsaraDB for MongoDB instance.
- Optional:If you want to connect to a replica set instance over the Internet, apply for a public endpoint for the replica set instance. For more information, see (Optional) Apply for a public endpoint for an ApsaraDB for MongoDB instance.