tencent cloud

TencentDB for MongoDB

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Strengths
Use Cases
Cluster Architecture
Product Specifications
Features
Regions and AZs
Terms
Service Regions and Service Providers
Purchase Guide
Billing Overview
MongoDB Pricing
Billing Formula
Payment Overdue
Backup Space Billing
Configuration Adjustment Billing
Getting Started
Quickly Creating an Instance
Connecting to a TencentDB for MongoDB Instance
Reading/Writing Database
Operation Guide
Access Management
Instance Management
Node Management
Version Upgrade
Network Configuration
Monitoring
Backup and Rollback
Database Audit
Data Security
SSL Authentication
Log Management
Database Management
Multi-AZ Deployment
Disaster Recovery/Read-Only Instances
Parameter Configuration
Recycle Bin
Task Management
Performance Optimization
Data Migration Guide
Practical Tutorial
Optimizing Indexes to Break Through Read/Write Performance Bottlenecks
Troubleshooting Mongos Load Imbalance in Sharded Cluster
Considerations for Using Shard Clusters
Sample of Reading and Writing Data in MongoDB Instance
Methods for Importing and Exporting Data Based on CVM Connected with MongoDB
What to Do for Errors of Repeated Instance Creation and Deletion of Databases with the Same Names?
Troubleshooting MongoDB Connection Failures
Shard Removal Task: Guide for Confirming the Progress and Troubleshooting Issues
Performance Fine-Tuning
Ops and Development Guide
Development Specifications
Command Support in Sharded Cluster v3.2
Command Support in v3.6
Development Ops
Troubleshooting
Increased Slow Queries
Number of Connections Exceeding Limit
API Documentation
History
Introduction
API Category
Making API Requests
Instance APIs
Backup APIs
Account APIs
Other APIs
Task APIs
Introduction
Data Types
Error Codes
Instance Connection
Shell Connection Sample
PHP Connection Sample
Node.js Connection Sample
Java Connection Sample
Python Connection Sample
Python Read/Write Sample
Go Connection Sample
PHP Reconnection Sample
Product Performance
Test Environment
Test Method
Test Result
FAQs
Cost
Features
Sharded Cluster
Instance
Rollback and Backup
Connection
Data Migration
Others
Service Agreement
Service Level Agreement
Terms of Service
Glossary
Contact Us

Promoting Secondary Node to Primary Node

PDF
フォーカスモード
フォントサイズ
最終更新日: 2024-04-02 15:05:25

Overview

A TencentDB for MongoDB replica set instance can have one primary node and multiple secondary nodes. If you find that the primary node is abnormal, you can actively promote a secondary node to primary node to ensure normal business operations. In a sharded cluster instance, all shard nodes are grouped into one primary node group, and all secondary nodes are grouped into multiple secondary node groups. If some shard nodes in the primary node group are abnormal, you can actively promote all nodes in a secondary node group to the primary node group.

Version description

TencentDB for MongoDB v3.6 and later support promoting secondary node to primary node.

Notes

When a node is promoted to primary node, existing TCP connections to the database will be closed. Therefore, before performing this operation, make sure that your business has an automatic reconnection mechanism; otherwise, you need to manually reconnect to the database.

Prerequisites

The instance is in Running status.

Directions

2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Sharded Cluster Instance. The directions for the two types of instances are similar.
3. Above the Instance List on the right, select the region.
4. In the instance list, find the target instance.
5. Click the Instance ID to enter the Instance Details page and click the Node Management tab.
6. On the Mongod Node tab on the Node Management tab, find the target secondary node in the node list.
Replica set instance: In the node list, find the target secondary node and click Promote to Primary Node in the Operation column.

Sharded cluster instance: In the node list, find the target secondary node group and click Promote to Primary Node in the top-right corner.

7. In the Promote to Primary Node window, select Confirm the risk of the promotion to primary node and click OK.
Note:
When a node is promoted to primary node, existing TCP connections to the database will be closed. Therefore, before performing this operation, make sure that your business has an automatic reconnection mechanism; otherwise, you need to manually reconnect to the database.
8. Return to the Instance Details page, you can see that Instance Status is Promoting to Primary Node. After this status disappears, the task is completed. On the Node Management tab, you can see that the Role of the original secondary node becomes PRIMARY.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック