DEV Community

Cover image for GBase 8s Database HAC Cluster Switch and Recovery Operations
Cong Li
Cong Li

Posted on

GBase 8s Database HAC Cluster Switch and Recovery Operations

In enterprise-level database management, High Availability Cluster (HAC) is a critical technology to ensure business continuity. The GBase 8s database system offers robust HAC cluster functionality, supporting various methods such as automatic switching, CM-controlled switching, and manual switching. This article provides a detailed guide on the switch and recovery operations of the GBase 8s HAC cluster to help database administrators effectively manage cluster status and ensure data stability and availability.

1. Automatic Switching Operations

The GBase 8s HAC cluster supports automatic switching. When a primary node fails or a network timeout occurs, the secondary node can automatically promote itself to a primary or standard node. This automatic switching depends on the setting of the DRAUTO parameter:

  • DRAUTO value of 2: The secondary node will automatically promote to the primary node.
  • DRAUTO value of 1: The secondary node will promote to a standard node.

To restore the original primary node, you can use the following methods:

  • Direct Start: Use the oninit -vy command.
  • Physical Recovery: Use the oninit -PHY command followed by onmode -d secondary <primary_node_service_name> to rejoin the cluster.
  • Backup Recovery.

2. CM-Controlled Switching Operations

In CM (Connection Manager) controlled switching, the promotion of the secondary node to the primary node is managed by CM. In this case, restoring the original primary node also requires physical or backup recovery methods:

  • Physical Recovery: Use the oninit -PHY command followed by onmode -d secondary <primary_node_service_name> to rejoin the cluster.
  • Backup Recovery.

3. Manual Switching Operations

Manual switching offers more flexible control. When the primary node fails or a network timeout occurs, the secondary node can be manually promoted to the primary node using the following methods:

  • Standard Mode Promotion: First switch to standard mode using the onmode -d standard command, then use onmode -d primary <peer_service_name> to promote to the primary node.
  • Direct Promotion: Use the onmode -d make primary <service_name> [force] command for direct promotion.

Restoring the original primary node also requires physical recovery to rejoin the cluster.

4. Primary and Secondary Node Switching Strategy

In a fault-free database cluster, if a primary-secondary node switch is required, consider the following strategies:

  • Simulate Primary Node Failure: Switch by simulating a failure.
  • Forced Switching: Use the onmode -d make primary <service_name> force command for forced switching.

For recovery, follow the same procedures as in the event of an actual failure.


The switching and recovery operations of the GBase 8s HAC cluster are crucial aspects of database management. This article aims to help database administrators better understand and master these operations, thereby enhancing the stability and reliability of the database system. In practice, it is recommended to choose the most appropriate switching and recovery strategies based on specific business requirements and system conditions.

Top comments (0)