tencent cloud

TencentDB for MongoDB

Creating a Disaster Recovery Instance

다운로드
포커스 모드
폰트 크기
마지막 업데이트 시간: 2026-10-23 20:55:13
AI 번역

Overview

For scenarios with strong requirements for business continuity and data reliability, or due to regulatory needs, you can create one or more disaster recovery instances across regions based on the current instance's cluster architecture and storage engine. If the region where the current instance is located loses communication due to power, network, or other force majeure factors in any AZ, and the HA system fails, the disaster recovery instance can be promoted to the primary instance. This allows cross-region disaster recovery, ensuring the continuity of data services.

Must-Knows

Due to data synchronization delay, the real-time synchronization of disaster recovery instances may not be guaranteed. The synchronization delay between each disaster recovery instance and the primary instance can be viewed in the console.
During the lifecycle of a disaster recovery instance, it is read-only and cannot be used for data writing or updates.
When the source instance of the disaster recovery instance is terminated, or the disaster recovery instance is manually promoted, it becomes a regular instance with full read/write capabilities, quickly supporting business needs.

Version Information

For version support details, see Feature Details. The versions supported in the console prevail.

Prerequisite

The current instance is running normally.
The region, AZ, and network for the disaster recovery instance have been planned.
The storage specifications and the number of disaster recovery instances have been estimated.
The billing mode has been selected based on the business scenario, and the necessary budget for the disaster recovery instance has been planned.

Creating a Disaster Recovery Instance

1. Log in to the MongoDB console.
2. In the left sidebar, choose NoSQL > MongoDB.
3. In the MongoDB dropdown list, select either Replica Set Instance or Shard Instance. The process for replica sets and sharded clusters is similar.
4. At the top of the instance list page, select the region.
5. In the instance list, find the target instance for which you want to create a disaster recovery instance.
You can use the search box in the top-right corner of the instance list to search for the target instance by entering the instance ID, instance name, private IP address, or tag key.
If the instance is not found in the instance list, choose Recycle Bin from the left sidebar to check whether the instance has been isolated due to expired fees. For more details, see Recycle Bin.
6. Click the target instance ID to enter the Instance Details page.
7. Select the RO/DR tab, then go to the DR instance page, and click Create .
8. On the TencentDB for MongoDB DR Instance purchase page, confirm the Primary Instance Info and select the required configuration.
See the table below to configure the instance specifications based on your actual needs.

Parameter Name
Description
Billing mode
Yearly/monthly subscription and pay-as-you-go are supported. For details on how to choose a billing mode, see Billing Overview.
Region
Select the region where the disaster recovery instance is located.
Specification Type
Consistent with the source instance.
AZ
Choose whether to enable multi-AZ deployment, based on the actual high availability business needs.
Database version
The database version is fixed to match the source instance and cannot be changed.
Architecture type
The architecture type is fixed to match the source instance and cannot be changed. For more details on architecture types, see System Architecture.
Storage engine
The default storage engine is WiredTiger.
Mongod specifications
Select the compute specifications for the database instance from the dropdown list. The number of CPU cores and memory capacity of the DR instance must be equal to or greater than those of the source instance. Higher specifications result in higher IOPS. For details on supported specifications, see Product Specifications.
After creating an instance, you can adjust its compute specifications. For specific operations, see Adjusting Instance Configuration.
Mongod shard count
This parameter is displayed when the cluster type is set to sharded cluster. It is used to set the number of shards in the sharded cluster, with a valid range of [2, 36].
The supported value ranges may vary by region. The values displayed in the console prevail.
The shard quantity of the DR instance must be equal to or greater than that of the source instance. Each shard is a replica set, and increasing the shard quantity can expand the cluster's storage capacity. Select based on your needs.
After creating the instance, you can adjust the number of Mongod shards. For detailed steps, see Adjust Instance Configuration.
Disk capacity
Select the storage capacity of the database instance on the slider. The disk capacity of the DR instance must be greater than or equal to that of the source instance. The valid range of disk capacity varies depending on the Mongod specifications. See Product Specifications. By default, the system allocates 10% of the selected storage capacity to Oplog. You can adjust the Oplog size in the instance list in the console. For detailed directions, see Adjust Oplog Capacity.
After creating an instance, you can adjust the instance's disk capacity. For specific operations, see Adjusting Instance Configuration.
Number of primary and secondary nodes
When the architecture type is set to replica set, this parameter is displayed. The default is 3 nodes (1 primary, 2 secondaries), with three storage nodes forming a one-primary-two-secondary architecture. Custom replication numbers are not currently adjustable. You may select from the dropdown list: 5 nodes (1 primary, 4 secondaries), or 7 nodes (1 primary, 6 secondaries).
After creating a DR instance, you can increase the number of secondary nodes. For detailed directions, see Add Secondary Nodes.
Number of primary and secondary nodes per shard
This parameter is displayed when the cluster type is sharded cluster. It is used to set the number of nodes in each shard of the sharded cluster. The default is 3 nodes (1 primary node and 2 secondary nodes), meaning each shard has a 3-node architecture with 1 primary node and 2 secondary nodes. You can select 5 nodes (1 primary node and 4 secondary nodes) or 7 nodes (1 primary node and 6 secondary nodes) from the dropdown list. Customizing the number of nodes is not supported.
After creating a DR instance, you can increase the number of secondary nodes in each shard. For detailed directions, see Add Secondary Nodes.
Number of read-only nodes
Set the number of read-only nodes. You can choose no read-only node or 1 to 5 read-only nodes. Configuring read-only nodes may vary across different versions. The actual resources allocated in the console prevail. After creating a DR instance, you can increase the number of read-only nodes. For detailed directions, see Add Read-only Nodes.
Configuration notes
The maximum number of connections for the instance is calculated based on the configured Mongod specifications, helping you predict whether the current specifications meet your expectations.
Mongos specifications
This parameter is displayed when the architecture type is set to Sharded Cluster. It is used to configure the specifications for Mongos. After the Mongod specifications are configured, Mongos will be automatically assigned default specifications. For example, if Mongod is configured with 2 cores and 4 GB, the default configuration for Mongos will be 1 core and 2 GB. Increasing the Mongos specifications will incur additional fees. For more details on pricing, see Product Pricing. The maximum number of connections for a sharded cluster is determined by the specifications and number of Mongos nodes. You can view the maximum number of connections in the configuration notes.
After creating the instance, you can change the configuration of the Mongos nodes. For detailed directions, see Change Mongos Node Configuration Specifications.
Number of Mongos
This parameter is displayed when the architecture type is set to Sharded Cluster. It is used to configure the number of Mongos nodes. If the instance is deployed in the same AZ, the valid range for Mongos nodes is [3, 32]. If multi-AZ deployment is enabled, and the instance is deployed across different AZs, the valid range for Mongos nodes is [6, 32]. Increasing the number of Mongos nodes will incur additional fees. For billing details, see Product Pricing.
After creating the instance, you can adjust the number of Mongos nodes. For detailed directions, see Add new Mongos nodes.
Network type
Only VPC is supported.
IPv4 network
Select the specific VPC and its subnet. It is recommended to choose the same VPC within the same region as that of your cloud server. The VPC has a region attribute (for example, Guangzhou), while the subnet has an AZ attribute (for example, Guangzhou Zone 1). A VPC can be divided into one or more subnets, and subnets within the same VPC have internal communication by default, whereas different VPCs (regardless of being in the same region) are isolated by default.
After purchasing the instance, you can switch the VPC. For detailed directions, see Switch Network. You can also click Create VPC and Create Subnet to recreate the required network environment. For more details, see Create VPC.
IPv6 network
Check whether to enable IPv6 access. Currently, it is not supported.
Security group
Set security group rules for the instance to control incoming traffic to the database. You can select an existing security group from the dropdown, or click Customize Security Group to set new inbound security group rules. For more details, see Configure Security Group.
Assign project
Assign the instance to the appropriate project. You can manage instances based on the assigned project.
Tag
Set tags for the instance. You can categorize and manage instances based on tags. Click Add to select a tag key and tag value.
Instance name
Set the instance name, which must contain 1 to 128 characters.
Quantity purchased
Select the quantity to purchase. The maximum quantity you can purchase is determined by the resources allocated in the console.
Purchase Duration
When selecting the yearly/monthly subscription billing mode, you need to choose the purchase duration of the instance. The longer the duration, the greater the discount. You can choose based on your actual business needs.
Auto-renewal
When selecting the yearly/monthly subscription billing mode, you can choose whether to enable the auto-renewal feature, which automatically deducts fees from your Tencent Cloud account on a monthly basis after expiration. If the auto-renewal feature is not enabled, pay attention to reminder messages and renew in a timely manner when fees are due. For detailed operations, see Renewal Instructions.
Total fees
When you select the yearly/monthly subscription billing mode, the total cost of the purchased specifications is displayed.
If you select pay-as-you-go, the hourly rate is displayed. Click Billing Details to view the pricing details. For more information, see Product Pricing.
9. Once you have confirmed the parameter configuration is correct, click Buy Now to complete the purchase. After the purchase success prompt is prompted, click Go to Console. In the instance list, once the instance status shows Running, it is ready for use.

Viewing Disaster Recovery Instance

1. Log in to the MongoDB console.
2. In the dropdown list under MongoDB in the left sidebar, choose either Replica Set Instance or Shard Instance. The process for replica sets and sharded instances is similar.
3. At the top of the instance list page, select the region.
4. In the instance list, find the source instance to which the disaster recovery instance belongs.
You can use the search box in the top-right corner of the instance list to search for the target instance by entering the instance ID, instance name, private IP address, or tag key.
If the instance is not found in the instance list, choose Recycle Bin from the left sidebar to check whether the instance has been isolated due to expired fees. For more details, see Recycle Bin.
5. In the Instance ID/Name column of the source instance, click the instance ID to go to the Instance Details page.
6. Click the RO/DR tab, and then select the DR instance tab.

7. In the disaster recovery instance list, view all disaster recovery instances under the source instance.
Parameter
Description
Instance ID
The DR instance ID and its name. Click the instance ID in blue to navigate to the DR instance details page. For more details, see View Instance Details.
Status
The current running status of the instance. The normal status is Running.
Specifications
Instance specification information, including memory and disk capacity.
Latency
The synchronization status and latency of the disaster recovery instance based on the source instance.
Number of nodes
The number of primary and secondary nodes in the disaster recovery instance.
Network
The name of the VPC to which the disaster recovery instance belongs.
Private IP address
The private IPV4 address assigned by the VPC. To access the database, you need to configure the private IP address and port information. For detailed directions, see Connecting Instances.
Region
Information about the region and AZ.
Expiration time
For monthly subscription billing, the specific expiration time of the instance is displayed. For pay-as-you-go billing, this field is blank.
Operations
Click Disconnect Sync to convert the DR instance into a primary instance.
Click Modify Configuration to adjust the specifications of the DR instance.
Note:
When adjusting the specifications of the source instance, be sure to upgrade the DR instance as well; otherwise, data loss may occur.

Promoting Disaster Recovery Instance to Primary Instance

1. Log in to the MongoDB console.
2. In the dropdown list under MongoDB in the left sidebar, choose either Replica Set Instance or Shard Instance. The process for replica sets and sharded instances is similar.
3. At the top of the instance list page, select the region.
4. In the instance list, find the source instance to which the disaster recovery instance belongs.
You can use the search box in the top-right corner of the instance list to search for the target instance by entering the instance ID, instance name, private IP address, or tag key.
If the instance is not found in the instance list, choose Recycle Bin from the left sidebar to check whether the instance has been isolated due to expired fees. For more details, see Recycle Bin.
5. In the Instance ID/Name column of the source instance, click Instance ID to enter the Instance Details page.
6. Click the RO/DR tab, and then select the DR instance tab.
7. In the disaster recovery instance list, find the instance you want to promote.
8. In the Operation column, click Disconnect Sync. In the Promote DR Instance dialog box, confirm the prompt information, and click OK.
9. The disaster recovery instance will immediately be converted to a regular instance and removed from the disaster recovery instance list.

Related API

API
Description
DescribeDBInstances
RenameInstance
RenewDBInstances

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백