Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Document Database Service/ User Guide/ Instance Modifications/ Changing Cluster Instance Nodes/ Manually Switching the Primary and Secondary Nodes of a Cluster

Manually Switching the Primary and Secondary Nodes of a Cluster

Updated on 2024-08-08 GMT+08:00

A cluster instance consists of a config node, and multiple dds mongos and shard nodes. Each shard or config is deployed as a three-node replica set including primary, secondary, and hidden nodes. Primary and secondary nodes do not provide IP addresses for external access. Hidden nodes are only used for backing up data. When a primary node becomes faulty, the system automatically selects a new primary node to ensure high availability. DDS supports primary/secondary switchovers for scenarios such as disaster recovery.

Precautions

  • To perform a switchover, the instance status needs to be Available, Abnormal, Changing to yearly/monthly, Changing a security group, or Heavy load.
  • The database connection may be interrupted during the switchover. Ensure that your client supports reconnection.
  • The longer the delay for primary/secondary synchronization, the more time is needed for a primary/secondary switchover. If the primary to secondary synchronization delay exceeds 300s, primary/secondary switchover is not supported. For details about the synchronization delay, see What Is the Time Delay for Primary/Secondary Synchronization in a Replica Set?

Performing a Primary/Secondary Switchover for a Config Node

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the cluster instance name.
  5. In the Node Information area on the Basic Information page, click the config tab and click Switch in the Operation column.

    Figure 1 Primary/Secondary switchover

  6. In the displayed dialog box, click Yes.

    Figure 2 Performing a primary/secondary switchover for a config node

  7. Check the result.

    • During the switchover process, the DB instance status changes to Switchover in progress. After the switchover is complete, the status is restored to Available.
    • In the Node Information area, you can view the switchover result.
    • After the switchover, the previous primary node becomes the secondary node. You need to reconnect to the primary node. For details, see Connecting to a DB Instance.

Performing a Primary/Secondary Switchover for a Shard Node

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the cluster instance name.
  5. In the Node Information area on the Basic Information page, click the shard tab, locate a target shard node, and choose More > Switch in the Operation column.

    Figure 3 Primary/Secondary switchover

  6. In the displayed dialog box, click Yes.

    Figure 4 Performing a primary/secondary switchover for a shard node

  7. Check the result.

    • During the switchover process, the DB instance status changes to Switchover in progress. After the switchover is complete, the status is restored to Available.
    • In the Node Information area, you can view the switchover result.
    • After the switchover, the previous primary node becomes the secondary node. You need to reconnect to the primary node. For details, see Connecting to a DB Instance.

Forcibly Promoting a Secondary Node to the Primary

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and a project.
  3. Click in the upper left corner of the page and choose Databases > Document Database Service.
  4. On the Instances page, click the cluster instance name.
  5. In the Node Information area on the Basic Information page, click the config or shard tab, locate the node whose role is Secondary, and click Promote to Primary.

    Figure 5 Promote to Primary

  6. In the displayed dialog box, click Yes.

    Figure 6 Forcibly promoting a secondary node to the primary

  7. Check the result.

    • In the Node Information area on the Basic Information page, you can view the result.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback