OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Deployer

V3.1.0Community Edition

  • What is obd
  • Quick Start
    • Install obd
    • Quickly deploy OceanBase Database
    • Quickly deploy OCP
    • Deploy an OceanBase cluster on the GUI
  • obd Command
    • Quick deployment command
    • Cluster commands
    • Mirror and repository commands
    • Testing commands
    • Tool commands
    • obdiag commands
    • Binlog commands
    • Telemetry commands
  • User Guide
    • Configuration files
    • Deploy through GUI
      • GUI operation overview
      • Deploy OCP through the GUI
      • Modify components on the GUI
    • Deploy through CLI
      • Deploy OceanBase Database on a single server
      • Deploy OCP Express by using commands
      • Deploy and use obconfigserver
      • Deploy the binlog service
      • Deploy oblogproxy by using the CLI
      • Deploy OCP by using commands
      • Use OCP to take over a cluster deployed by obd
      • Use obd to take over a cluster
      • Add GUI-based monitoring for an existing cluster
      • Upgrade OCP Express
      • Upgrade OceanBase Database
      • Physical Standby Database
        • Deploy primary and standby tenants by using obd
        • Switch the roles of tenants and decouple a standby tenant from the primary tenant
      • Scale out a cluster and change cluster components
      • Performance test
      • Cluster diagnotistics
  • FAQ
    • FAQ
    • How do I upgrade an OBProxy to obproxy-ce 3.2.3?
  • Mode configuration rules
  • Error codes
  • Release Notes
    • Version rules
    • 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 Deployer V2.8.0
    • V2.7
      • OceanBase Deployer V2.7.0
    • V2.6
      • OceanBase Deployer V2.6.2
      • OceanBase Deployer V2.6.1
      • OceanBase Deployer V2.6.0
    • V2.5
      • OceanBase Deployer V2.5.0
    • V2.4
      • OceanBase Deployer V2.4.0
    • V2.3
      • OceanBase Deployer V2.3.1
      • OceanBase Deployer V2.3.0
    • V2.2
      • OceanBase Deployer V2.2.0
    • V2.1
      • OceanBase Deployer V2.1.1
      • OceanBase Deployer V2.1.0
    • V2.0
      • OceanBase Deployer V2.0.1
      • OceanBase Deployer 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

Download PDF

What is obd Install obd Quickly deploy OceanBase Database Quickly deploy OCP Deploy an OceanBase cluster on the GUI Quick deployment command Cluster commands Mirror and repository commands Testing commands Tool commands obdiag commands Binlog commands Telemetry commands Configuration files GUI operation overview Deploy OCP through the GUI Modify components on the GUI Deploy OceanBase Database on a single server Deploy OCP Express by using commands Deploy and use obconfigserver Deploy the binlog service Deploy oblogproxy by using the CLI Deploy OCP by using commands Use OCP to take over a cluster deployed by obd Use obd to take over a cluster Add GUI-based monitoring for an existing cluster Upgrade OCP Express Upgrade OceanBase Database Scale out a cluster and change cluster components Performance test Cluster diagnotistics FAQ How do I upgrade an OBProxy to obproxy-ce 3.2.3? Mode configuration rules Error codes Version rules OceanBase Deployer V3.1.2 OceanBase Deployer V3.1.1 OceanBase Deployer V3.1.0 OceanBase Deployer V3.0.1 OceanBase Deployer V3.0.0 OceanBase Deployer V2.10.1 OceanBase Deployer V2.10.0 OceanBase Deployer V2.9.2 OceanBase Deployer V2.9.1 OceanBase Deployer V2.9.0 OceanBase Deployer V2.8.0 OceanBase Deployer V2.7.0 OceanBase Deployer V2.6.2 OceanBase Deployer V2.6.1 OceanBase Deployer V2.6.0 OceanBase Deployer V2.5.0 OceanBase Deployer V2.4.0 OceanBase Deployer V2.3.1 OceanBase Deployer V2.3.0 OceanBase Deployer V2.2.0 OceanBase Deployer V2.1.1 OceanBase Deployer V2.1.0 OceanBase Deployer V2.0.1 OceanBase Deployer V2.0.0 OceanBase Deployer V1.6.2 OceanBase Deployer V1.6.1 OceanBase Deployer V1.6.0 OceanBase Deployer V1.5.0 OceanBase Deployer V1.4.0 OceanBase Deployer V1.3.3 OceanBase Deployer V1.3.2 OceanBase Deployer V1.3.0 OceanBase Deployer V1.2.1 OceanBase Deployer V1.2.0
OceanBase logo

The Unified Distributed Database for the Al Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Deployer
  3. V3.1.0
iconOceanBase Deployer
V 3.1.0Community Edition
Community Edition
  • V 3.2.1
  • V 3.2.0
  • V 3.1.0
  • V 3.0.0
  • V 2.10.1
  • V 2.10.0
  • V 2.9.0
  • V 2.8.0
  • V 2.7.0
  • V 2.6.0
  • V 2.5.0
  • V 2.4.0
  • V 2.3.1
  • V 2.3.0
  • V 2.2.0
  • V 2.1.0
  • V 2.0.0
  • V 1.6.1

Deploy primary and standby tenants by using obd

Last Updated:2025-03-21 08:41:19  Updated
share
What is on this page
Concepts
Prerequisites
Scenario 1: one primary tenant, one standby tenant
Scenario 2: One primary tenant, two standby tenants
Scenario 3: One primary tenant with cascading standby tenants
FAQ
The error message "primary cluster have not full log xxx" is returned when a standby tenant is being created

folded

share

This topic describes how to use OceanBase Deployer (obd) to quickly deploy primary and standby tenants in three scenarios.

Note

At present, obd only supports network-based primary/standby tenant deployment.

Concepts

A physical standby database is an important part of the high availability solution of OceanBase Database. It can provide high availability, data protection, and disaster recovery for your key applications.

The physical standby database serves as a quasi-real-time hot backup for the production database of OceanBase Database. If the primary database becomes unavailable due to planned or unplanned events (such as the failure of the majority of replicas), a standby database takes over the services and provides both lossless switching (RPO = 0) and lossy switching (RPO > 0), minimizing service downtime and possible data loss. For more information, see Physical standby database disaster recovery in OceanBase Database Documentation.

Prerequisites

  • The clusters where the primary and standby tenants respectively reside have been created. The clusters use the same OceanBase Database version, which is V4.2.0 or later.

  • The primary tenant is a user tenant and has full logs.

    Run the command SELECT LS_ID, BEGIN_LSN FROM oceanbase.GV$OB_LOG_STAT WHERE ROLE = 'LEADER' ; to check the value of BEGIN_LSN. If it is 0, the current log stream replica has the complete log since its creation.

  • The cluster where the primary tenant resides is running.

    Run the obd cluster display command to view the cluster status.

  • To try out the feature, allocate a minimum of one CPU core, 2 GB of memory, and 4 GB of log disk space for the primary tenant. For long-term use, it is recommended to allocate at least one CPU core and 4 GB of memory.

Scenario 1: one primary tenant, one standby tenant

In this scenario, there are two clusters: clusterA and clusterB. In clusterA, a user tenant A_a (primary tenant) is created. In clusterB, a standby tenant (B_a) is created for tenant A_a. The steps to perform this operation are as follows:

  1. Create the standby tenant B_a for tenant A_a:

    obd cluster tenant create-standby clusterB clusterA A_a -t B_a --tenant-root-password=*****
    
  2. View the primary/standby relationship of the standby tenant:

    obd cluster tenant show clusterB -g
    

    where the -g option displays the primary/standby relationships related to a cluster in a graph.

    The returned results are as follows:

    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                     tenant base info                                                                                    |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | tenant_name | tenant_type | compatibility_mode | primary_zone | max_cpu | min_cpu | memory_size | max_iops            | min_iops            | log_disk_size | iops_weight | tenant_role |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | sys         | SYS         | MYSQL              | RANDOM       | 1.0     | 1.0     | 2.0G        | 9223372036854775807 | 9223372036854775807 | 2.0G          | 1           | PRIMARY     |
    | B_a         | USER        | MYSQL              | RANDOM       | 2.0     | 2.0     | 4.0G        | 10000               | 10000               | 5.0G          | 2           | STANDBY     |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                   standby tenant standby info                                                                   |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | standby_tenant_name | tenant_status | sync_status | sync_scn_timestamp         | err_code | error_comment | switchover_status | switchover_epoch | log_mode     |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | B_a                 | NORMAL        | NORMAL      | 2023-09-14 08:58:44.173462 | 0        |               | NORMAL            | 0                | NOARCHIVELOG |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                   standby tenant's primary info                                                                                   |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | standby_tenant_name | primary_tenant_info                                                                                                                                                         |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | B_a                 | IP_LIST=10.10.10.1:2881;10.10.10.2:2881;10.10.10.3:2881,USER=standbyro@A_a,PASSWORD=******,TENANT_ID=1002,CLUSTER_ID=1694680744,COMPATIBILITY_MODE=MYSQL,IS_ENCRYPTED=false |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    query primary-standby relation ok
    
    primary-standby relation topology graph
    
    clusterA:A_a
    └── clusterB:B_a
    

    As shown in the returned results, the values of both tenant_status and sync_status are NORMAL, indicating that the standby tenant is successfully created and the log transmission is normal.

    The fields in the returned results are described as follows:

    • tenant base info: displays information about tenants in the cluster. You need to pay attention to the following fields.

      Field Description
      tenant_name The name of the tenant.
      tenant_type The type of the tenant. Valid values: SYS (sys tenant) and USER (user tenant).
      compatibility_mode The compatibility mode of the tenant. Valid values: MySQL and Oracle. OceanBase Database Community Edition only supports MySQL mode.
      primary_zone The primary zone of the tenant.
      tenant_role The role of the tenant. Valid values: PRIMARY and STANDBY.
    • standby tenant standby info: displays information about standby tenants in the cluster. You need to pay attention to the following fields.

      Field Description
      standby_tenant_name The name of the standby tenant.
      tenant_status The state of the standby tenant. The value NORMAL indicates that the standby tenant is normal.
      sync_status The log synchronization status of the standby tenant. The value NORMAL indicates that log synchronization is normal.
      sync_scn_timestamp The log synchronization timestamp.
      err_code The error code for log synchronization.
      error_comment The error message for log synchronization.
      switchover_status The switchover status. The value NORMAL indicates that the switchover is normal.
      switchover_epoch The switchover time.
      log_mode The log type. The log type is NOARCHIVELOG for network-based synchronization between the primary and standby tenants.
    • standby tenant's primary info: displays information about the primary tenants of standby tenants in the cluster. You need to pay attention to the following fields.

      Field Description
      standby_tenant_name The name of the standby tenant.
      primary_tenant_info The information about the primary tenant, including the IP address of the node where the cluster of the primary tenant resides, the name of the primary tenant, the password of the standbyro user, the ID of the primary tenant, and the ID of the cluster where the primary tenant resides.
  3. Log on to the primary and standby tenants separately. Modify information in the primary tenant (A_a) and check whether the changes are synchronized in the standby tenant (B_a).

Scenario 2: One primary tenant, two standby tenants

In this scenario, there are three clusters: clusterA, clusterB, and clusterC. In clusterA, a user tenant A_a (primary tenant) is created. In clusterB and clusterC, two standby tenants (B_a and C_a) are created for tenant A_a, respectively. The steps to perform this operation are as follows:

  1. Create the standby tenant B_a for tenant A_a:

    obd cluster tenant create-standby clusterB clusterA A_a -t B_a --tenant-root-password=*****
    
  2. Create the standby tenant C_a for tenant A_a:

    obd cluster tenant create-standby clusterC clusterA A_a -t C_a --tenant-root-password=*****
    
  3. View the primary/standby relationship of the standby tenant, for example, in clusterB:

    obd cluster tenant show clusterB -g
    

    where the -g option displays the primary/standby relationships related to a cluster in a graph.

    The returned results are as follows:

    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                     tenant base info                                                                                    |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | tenant_name | tenant_type | compatibility_mode | primary_zone | max_cpu | min_cpu | memory_size | max_iops            | min_iops            | log_disk_size | iops_weight | tenant_role |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | sys         | SYS         | MYSQL              | RANDOM       | 1.0     | 1.0     | 2.0G        | 9223372036854775807 | 9223372036854775807 | 2.0G          | 1           | PRIMARY     |
    | B_a         | USER        | MYSQL              | RANDOM       | 2.0     | 2.0     | 4.0G        | 10000               | 10000               | 5.0G          | 2           | STANDBY     |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                   standby tenant standby info                                                                   |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | standby_tenant_name | tenant_status | sync_status | sync_scn_timestamp         | err_code | error_comment | switchover_status | switchover_epoch | log_mode     |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | B_a                 | NORMAL        | NORMAL      | 2023-09-14 09:12:13.819821 | 0        |               | NORMAL            | 0                | NOARCHIVELOG |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                   standby tenant's primary info                                                                                   |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | standby_tenant_name | primary_tenant_info                                                                                                                                                         |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | B_a                 | IP_LIST=10.10.10.1:2881;10.10.10.2:2881;10.10.10.3:2881,USER=standbyro@A_a,PASSWORD=******,TENANT_ID=1002,CLUSTER_ID=1694680744,COMPATIBILITY_MODE=MYSQL,IS_ENCRYPTED=false |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    query primary-standby relation ok
    
    primary-standby relation topology graph
    
    clusterA:A_a
    ├── clusterB:B_a
    └── clusterC:C_a
    

    As shown in the returned results, the values of both tenant_status and sync_status are NORMAL, indicating that the standby tenant is successfully created and the log transmission is normal. For more information about the fields in the returned results, see the field description in Scenario 1.

  4. Log on to the primary and standby tenants separately. Modify information in the primary tenant (A_a) and check whether the changes are synchronized in the standby tenants (B_a and C_a).

Scenario 3: One primary tenant with cascading standby tenants

In this scenario, there are three clusters: clusterA, clusterB, and clusterC. In clusterA, a user tenant A_a (primary tenant) is created. In clusterB, a standby tenant B_a is created for tenant A_a. In clusterC, a standby tenant C_a is created for tenant B_a. The steps to perform this operation are as follows:

  1. Create the standby tenant B_a for tenant A_a:

    obd cluster tenant create-standby clusterB clusterA A_a -t B_a --tenant-root-password=*****
    
  2. Check whether tenant B_a is successfully created:

    obd cluster tenant show clusterB -g
    

    where the -g option displays the primary/standby relationships related to a cluster in a graph.

    The returned results are as follows:

    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                     tenant base info                                                                                    |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | tenant_name | tenant_type | compatibility_mode | primary_zone | max_cpu | min_cpu | memory_size | max_iops            | min_iops            | log_disk_size | iops_weight | tenant_role |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | sys         | SYS         | MYSQL              | RANDOM       | 1.0     | 1.0     | 2.0G        | 9223372036854775807 | 9223372036854775807 | 2.0G          | 1           | PRIMARY     |
    | B_a         | USER        | MYSQL              | RANDOM       | 2.0     | 2.0     | 4.0G        | 10000               | 10000               | 5.0G          | 2           | STANDBY     |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                   standby tenant standby info                                                                   |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | standby_tenant_name | tenant_status | sync_status | sync_scn_timestamp         | err_code | error_comment | switchover_status | switchover_epoch | log_mode     |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | B_a                 | NORMAL        | NORMAL      | 2023-09-14 08:58:44.173462 | 0        |               | NORMAL            | 0                | NOARCHIVELOG |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                   standby tenant's primary info                                                                                   |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | standby_tenant_name | primary_tenant_info                                                                                                                                                         |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | B_a                 | IP_LIST=10.10.10.1:2881;10.10.10.2:2881;10.10.10.3:2881,USER=standbyro@A_a,PASSWORD=******,TENANT_ID=1002,CLUSTER_ID=1694680744,COMPATIBILITY_MODE=MYSQL,IS_ENCRYPTED=false |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    query primary-standby relation ok
    
    primary-standby relation topology graph
    
    clusterA:A_a
    └── clusterB:B_a
    

    As shown in the returned results, the values of both tenant_status and sync_status are NORMAL, indicating that the standby tenant is successfully created and the log transmission is normal. For more information about the fields in the returned results, see the field description in Scenario 1.

  3. Create the standby tenant C_a for tenant B_a:

    Note

    It is recommended to wait for the synchronization of tenant B_a to be completed before creating tenant C_a.

    obd cluster tenant create-standby clusterC clusterB B_a -t C_a --tenant-root-password=*****
    
  4. View the primary/standby relationship of the standby tenant, for example, in clusterB:

    obd cluster tenant show clusterB -g
    

    where the -g option displays the primary/standby relationships related to a cluster in a graph.

    The returned results are as follows:

    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                     tenant base info                                                                                    |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | tenant_name | tenant_type | compatibility_mode | primary_zone | max_cpu | min_cpu | memory_size | max_iops            | min_iops            | log_disk_size | iops_weight | tenant_role |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    | sys         | SYS         | MYSQL              | RANDOM       | 1.0     | 1.0     | 2.0G        | 9223372036854775807 | 9223372036854775807 | 2.0G          | 1           | PRIMARY     |
    | B_a         | USER        | MYSQL              | RANDOM       | 2.0     | 2.0     | 4.0G        | 10000               | 10000               | 5.0G          | 2           | STANDBY     |
    +-------------+-------------+--------------------+--------------+---------+---------+-------------+---------------------+---------------------+---------------+-------------+-------------+
    +-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                   standby tenant standby info                                                                   |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | standby_tenant_name | tenant_status | sync_status | sync_scn_timestamp         | err_code | error_comment | switchover_status | switchover_epoch | log_mode     |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    | B_a                 | NORMAL        | NORMAL      | 2023-09-14 09:24:48.737141 | 0        |               | NORMAL            | 0                | NOARCHIVELOG |
    +---------------------+---------------+-------------+----------------------------+----------+---------------+-------------------+------------------+--------------+
    +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    |                                                                                   standby tenant's primary info                                                                                   |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | standby_tenant_name | primary_tenant_info                                                                                                                                                         |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | B_a                 | IP_LIST=10.10.10.1:2881;10.10.10.2:2881;10.10.10.3:2881,USER=standbyro@A_a,PASSWORD=******,TENANT_ID=1002,CLUSTER_ID=1694680744,COMPATIBILITY_MODE=MYSQL,IS_ENCRYPTED=false |
    +---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    query primary-standby relation ok
    
    primary-standby relation topology graph
    
    clusterA:A_a
    └── clusterB:B_a
        └── clusterC:C_a
    
  5. Log on to the primary and standby tenants separately. Modify information in the primary tenant (A_a) and check whether the changes are synchronized in the standby tenant (B_a) and in the standby tenant (C_a) of B_a.

FAQ

The error message "primary cluster have not full log xxx" is returned when a standby tenant is being created

Possible Cause: The primary tenant does not have full logs.

Network-based synchronization between the primary and standby tenants requires the primary tenant to have full logs. Before the command is executed to create a standby tenant, obd will first check whether the BEGIN_LSN value of the log stream of the primary tenant is 0. If yes, the replica of the current log stream has full logs since its creation. If no, the replica of the current log stream does not have full logs, indicating that obd cannot create a standby tenant based on network synchronization.

Solution: Log on to the primary tenant and run the following command to check whether the BEGIN_LSN value of the log stream of the primary tenant is 0:

SELECT LS_ID, BEGIN_LSN FROM oceanbase.GV$OB_LOG_STAT WHERE ROLE = 'LEADER' ;

If the BEGIN_LSN value of the log stream of the primary tenant is not 0, the primary tenant does not have full logs, indicating that a standby tenant cannot be created for the primary tenant using obd. Instead, use SQL statements to create a standby tenant for the primary tenant by referring to Create a standby tenant in OceanBase Database Documentation.

Previous topic

Upgrade OceanBase Database
Last

Next topic

Switch the roles of tenants and decouple a standby tenant from the primary tenant
Next
What is on this page
Concepts
Prerequisites
Scenario 1: one primary tenant, one standby tenant
Scenario 2: One primary tenant, two standby tenants
Scenario 3: One primary tenant with cascading standby tenants
FAQ
The error message "primary cluster have not full log xxx" is returned when a standby tenant is being created