OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Deployer

V4.3.0Community Edition
  • What is obd
  • Quick Start
    • Install obd
    • Quick deployment of OceanBase Database
    • Quickly deploy OCP
  • obd Command
    • Quick deployment commands
    • Cluster commands
    • Command groups
    • Image and repository commands
    • Test command groups
    • Tool commands
    • obdiag commands
    • Binlog service commands
    • Hardware commands
    • License commands
    • Password commands
    • Telemetry commands
  • User Guide
    • Usage overview
    • Deploy through GUI
      • Overview
      • Pattern configuration rules
      • Deploy an OceanBase cluster
      • Deploy OCP
      • Deploy OMS
      • Change components
      • Upgrade OCP
      • Upgrade OMS
    • Deploy through CLI
      • Configuration file
      • Component deployment
        • Deploy an OceanBase cluster
        • Deploy seekdb
        • Deploy obconfigserver
        • Deploy OMS
        • Deploy OCP
        • Deploy Alertmanager
        • Deploy obbinlog
        • Deploy oblogproxy
      • Cluster management
        • Physical Standby Database
          • Create a standby tenant
          • Role switching and decoupling
          • Switch the synchronization mode between primary and standby tenants
        • seekdb primary/standby instance
          • Create a standby instance
          • Role switching and decoupling
        • Scale out and component changes
        • Performance test
        • Diagnose a cluster
        • Backup and restore
        • Add a GUI monitoring system to an existing cluster
      • Cluster management
        • Use OCP to take over an OceanBase cluster deployed by obd
        • Take over an OceanBase cluster
      • Component upgrade
        • Upgrade OceanBase Database
        • Upgrade ODP
        • Upgrade OMS
  • Upgrade obd
  • FAQ
  • Error codes
  • Release Notes
    • Version rules
    • V4.3
      • OceanBase Deploy V4.3.0
    • V4.2
      • OceanBase Deployment Tool V4.2.0
    • V4.1
      • OceanBase Deployer V4.1.0
    • V4.0
      • OceanBase Deployer V4.0.0
    • V3.6
      • OceanBase Deployer V3.6.0
    • V3.5
      • OceanBase Deployer V3.5.0
    • V3.4
      • OceanBase Deployer V3.4.0
    • V3.3
      • OceanBase Deployer V3.3.0
    • V3.2
      • OceanBase Deployer V3.2.2
      • OceanBase Deployer V3.2.1
      • OceanBase Deployer V3.2.0
    • V3.1
      • OceanBase Deployer V3.1.2
      • OceanBase Deployer V3.1.1
      • OceanBase Deployer V3.1.0
    • V3.0
      • OceanBase Deployer V3.0.1
      • OceanBase Deployer V3.0.0
    • V2.10
      • OceanBase Deployer V2.10.1
      • OceanBase Deployer V2.10.0
    • V2.9
      • OceanBase Deployer V2.9.2
      • OceanBase Deployer V2.9.1
      • OceanBase Deployer V2.9.0
    • V2.8
      • OceanBase Deployment Tool V2.8.0
    • V2.7
      • OceanBase Deployment Tool V2.7.0
    • V2.6
      • OceanBase Deployment Tool V2.6.2
      • OceanBase Deployment Tool V2.6.1
      • OceanBase Deployment Tool V2.6.0
    • V2.5
      • OceanBase Deployer V2.5.0
    • V2.4
      • OceanBase Deployer V2.4.0
    • V2.3
      • OceanBase Deployment Tool V2.3.1
      • OceanBase Deployer V2.3.0
    • V2.2
      • OceanBase Deployment Tool V2.2.0
    • V2.1
      • OceanBase Deployer V2.1.1
      • OceanBase Deployment Tool V2.1.0
    • V2.0
      • OceanBase Deployment Tool V2.0.1
      • OceanBase Deployment Tool V2.0.0
    • V1.6
      • OceanBase Deployer V1.6.2
      • OceanBase Deployer V1.6.1
      • OceanBase Deployer V1.6.0
    • V1.5
      • OceanBase Deployer V1.5.0
    • V1.4
      • OceanBase Deployer V1.4.0
    • V1.3
      • OceanBase Deployer V1.3.3
      • OceanBase Deployer V1.3.2
      • OceanBase Deployer V1.3.0
    • V1.2
      • OceanBase Deployer V1.2.1
      • OceanBase Deployer V1.2.0
  • Interactive deployment of OceanBase Database Community Edition
  • Deploy a Community Edition cluster using the obd graphical interface
  • Deploy a Community Edition cluster by using an obd configuration file

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Deployer
  3. V4.3.0

Role switching and decoupling

Last Updated:2026-09-04 08:21:29

Concepts
Switchover
Prerequisites
Procedure
Failover
Prerequisites
Procedure
Decouple the primary and standby instances
Prerequisites
Procedure

This topic describes how to use obd to dynamically change the role of the seekdb instance and how to decouple the primary and standby instances.

Concepts

A primary-standby pair is a high-availability solution provided by seekdb. The primary instance (PRIMARY) is the business instance that you create. It supports complete database capabilities, including queries, DML, and DDL operations. The standby instance (STANDBY) provides only disaster recovery and read-only capabilities.

obd allows you to dynamically change the role of an instance by using commands.

  • Switchover

    A switchover operation changes the role of an instance as planned. After a switchover operation is performed, the primary and standby instances exchange their roles. During the switchover, no data is lost, and the RPO is 0. The switchover operation usually takes a few seconds.

  • Failover

    A failover operation changes the role of an instance when the primary instance fails. After a failover operation is performed, the standby instance becomes the primary instance. If the standby instance is synchronized with the primary instance before the failure, a failover operation usually causes a data loss of a few hundred milliseconds. The failover operation usually takes a few seconds.

  • Decouple

    A decouple operation changes the role of an instance as planned. After a decouple operation is performed, the standby instance is decoupled from the primary instance and becomes the primary instance.

Switchover

After a switchover operation is performed, to ensure that the topology remains unchanged, the other standby instances under the original primary instance are switched to the new primary instance, and the other standby instances under the new primary instance are switched to the new standby instance. Only the two primary and standby nodes involved in the switchover operation exchange their roles. The other nodes remain in their original positions. The following figure shows the result.

Prerequisites

  • The version of seekdb must be V1.2.0 or later.

  • Both the primary and standby instances are managed by obd and are online. You can run the obd seekdb display command to view the instance status.

Procedure

  1. View the primary-standby relationship of the seekdb instance.

    Run the following command to view the primary-standby relationship of the seekdb instance. In this example, the seekdb_B instance is viewed.

    obd seekdb display seekdb_B -g
    

    The -g parameter displays the primary-standby topology. The output is as follows:

    Get local repositories and plugins ok
    Open ssh connection ok
    Connect to seekdb 10.10.10.1:2881 ok
    Wait for seekdb init ok
    +--------------------------------+
    |             seekdb             |
    +---------------+---------+------+
    | ip            | version | port |
    +---------------+---------+------+
    | 10.10.10.1    | 1.2.0.0 | 2881 |
    +---------------+---------+------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    Cluster Topology:
    
    seekdb_A
    └── seekdb_B
        └── seekdb_C
    
  2. Run the switchover command for the standby instance.

    obd seekdb switchover seekdb_B
    
  3. View the primary-standby relationship of the original standby instance.

    obd seekdb display seekdb_B -g
    

    The -g parameter displays the primary-standby topology. The output is as follows, indicating that the primary-standby relationship has been updated.

    Get local repositories and plugins ok
    Open ssh connection ok
    Connect to seekdb 10.10.10.1:2881 ok
    Wait for seekdb init ok
    +--------------------------------+
    |             seekdb             |
    +---------------+---------+------+
    | ip            | version | port |
    +---------------+---------+------+
    | 10.10.10.1    | 1.2.0.0 | 2881 |
    +---------------+---------+------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    Cluster Topology:
    
    seekdb_B
    └── seekdb_A
        └── seekdb_C
    

Failover

A failover operation changes the role of an instance when the primary instance fails. The failover operation modifies only the log files and does not modify the data files.

Notice

In a one-primary-and-multiple-standby scenario, after you run a failover operation to change a standby instance to the primary instance, the other standby instances cannot be switched to the new primary instance. You must choose to decouple the other standby instances or run a failover operation on them to generate new primary instances.

Prerequisites

  • The version of seekdb must be V1.2.0 or later.

  • Both the primary and standby instances are managed by obd.

  • The primary instance is unavailable. You can run the obd seekdb display command to view the instance status.

  • The standby instance is online. You can run the obd seekdb display command to view the instance status.

Procedure

  1. View the primary-standby relationship of the seekdb instance.

    Run the following command to view the primary-standby relationship of the seekdb instance. In this example, the seekdb_B instance is viewed.

    obd seekdb display seekdb_B -g
    

    The -g parameter displays the primary-standby topology. The output is as follows:

    Get local repositories and plugins ok
    Open ssh connection ok
    Connect to seekdb 10.10.10.1:2881 ok
    Wait for seekdb init ok
    +--------------------------------+
    |             seekdb             |
    +---------------+---------+------+
    | ip            | version | port |
    +---------------+---------+------+
    | 10.10.10.1    | 1.2.0.0 | 2881 |
    +---------------+---------+------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    Cluster Topology:
    
    seekdb_A
    └── seekdb_B
        └── seekdb_C
    
  2. Run the failover command for the standby instance.

    obd seekdb failover seekdb_B
    
  3. View the primary-standby relationship of the original standby instance.

    obd seekdb display seekdb_B -g
    

    The -g parameter displays the primary-standby topology. The output is as follows:

    Get local repositories and plugins ok
    Open ssh connection ok
    Connect to seekdb 10.10.10.1:2881 ok
    Wait for seekdb init ok
    +--------------------------------+
    |             seekdb             |
    +---------------+---------+------+
    | ip            | version | port |
    +---------------+---------+------+
    | 10.10.10.1    | 1.2.0.0 | 2881 |
    +---------------+---------+------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    Cluster Topology:
    
    seekdb_B
        └── seekdb_C
    

Decouple the primary and standby instances

You can run the decouple command to decouple the standby instance from the primary instance. This topic describes how to run the decouple command to decouple the primary and standby instances.

Prerequisites

  • The version of seekdb must be V1.2.0 or later.

  • Both the primary and standby instances are managed by obd and are online. You can run the obd seekdb display command to view the instance status.

Procedure

  1. View the primary-standby relationship of the seekdb instance.

    Run the following command to view the primary-standby relationship of the seekdb instance. In this example, the seekdb_B instance is viewed.

    obd seekdb display seekdb_B -g
    

    The -g parameter displays the primary-standby topology. The output is as follows:

    Get local repositories and plugins ok
    Open ssh connection ok
    Connect to seekdb 10.10.10.1:2881 ok
    Wait for seekdb init ok
    +--------------------------------+
    |             seekdb             |
    +---------------+---------+------+
    | ip            | version | port |
    +---------------+---------+------+
    | 10.10.10.1    | 1.2.0.0 | 2881 |
    +---------------+---------+------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    Cluster Topology:
    
    seekdb_A
    └── seekdb_B
        └── seekdb_C
    
  2. Run the decouple command for the standby instance.

    obd seekdb decouple seekdb_B
    
  3. View the primary-standby relationship of the original standby instance.

    obd seekdb display seekdb_B -g
    

    The -g parameter displays the primary-standby topology. The output is as follows:

    Get local repositories and plugins ok
    Open ssh connection ok
    Connect to seekdb 10.10.10.1:2881 ok
    Wait for seekdb init ok
    +--------------------------------+
    |             seekdb             |
    +---------------+---------+------+
    | ip            | version | port |
    +---------------+---------+------+
    | 10.10.10.1    | 1.2.0.0 | 2881 |
    +---------------+---------+------+
    obclient -h10.10.10.1 -P2881 -uroot -p'********' -Doceanbase -A
    
    Cluster Topology:
    
    seekdb_B
        └── seekdb_C
    

Previous topic

Create a standby instance
Last

Next topic

Scale out and component changes
Next
on this page
Concepts
Switchover
Prerequisites
Procedure
Failover
Prerequisites
Procedure
Decouple the primary and standby instances
Prerequisites
Procedure