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 Diagnostic Tool

V3.3.0

  • Overview
  • Install obdiag
  • Configure obdiag
  • One-click Cluster Inspection
    • Use obdiag to inspect an OceanBase cluster
    • Inspection metrics
  • One-click Information Collection
    • One-click General Information Collection
      • obdiag gather log
      • obdiag gather sysstat
      • obdiag gather plan_monitor
      • obdiag gather stack
      • obdiag gather perf
      • obdiag gather ash
      • obdiag gather tabledump
      • obdiag gather parameter
      • obdiag gather variable
      • obdiag gather clog/obdiag gather slog
      • obdiag gather obproxy_log
      • obdiag gather all
    • One-click Scenario-based Information Collection
      • Overview
      • observer.base
      • observer.backup
      • observer.backup_clean
      • observer.clog_disk_full
      • observer.cluster_down
      • observer.compaction
      • observer.cpu_high
      • observer.delay_of_primary_and_backup
      • observer.io
      • observer.log_archive
      • observer.long_transaction
      • observer.memory
      • observer.perf_sql
      • observer.px_collect_log
      • observer.recovery
      • observer.restart
      • observer.rootservice_switch
      • observer.suspend_transaction
      • observer.unit_data_imbalance
      • observer.perf_sql
      • observer.topsql
      • other.application_error
      • obproxy.restart
      • observer.unknown
  • One-click Diagnostic Analysis
    • obdiag analyze log
    • obdiag analyze flt_trace
    • obdiag analyze parameter default
    • obdiag analyze parameter diff
    • obdiag analyze variable diff
    • obdiag analyze index_space
    • obdiag analyze memory
    • obdiag analyze queue
  • One-click Root Cause Analysis
    • Use obdiag for root cause analysis
    • disconnection
    • major_hold
    • lock_conflict
    • ddl_disk_full
    • clog_disk_full
    • log_error
    • ddl_failure
    • index_ddl_error
    • transaction_disconnection
    • transaction_execute_timeout
    • transaction_not_ending
    • transaction_other_error
    • transaction_rollback
    • transaction_wait_timeout
    • oms_full_trans
    • oms_obcdc
    • suspend_transaction
  • One-click Cluster Display
    • Overview
    • Basic information of a cluster
    • Information about nodes in a cluster
    • Information about units in a cluster
    • Information about zones in a cluster
    • RootService information of a cluster
    • Information about tenants in a cluster
    • Information about events in a cluster
    • Information about locks in a cluster
    • Information about top SQL statements in a cluster
    • Information about slow SQL statements in a cluster
    • Information about tables in a cluster
    • Information about the process list in a tenant
    • Information about the execution plan of an SQL statement
    • Disk usage of a database
    • Disk usage of the specified table in a database
    • Information about all tenants in a cluster
    • Information about CPU utilization of nodes in a cluster
    • Internal table names fuzzy matched with the specified keyword
    • Information about leaders in a cluster
    • Information about locks on a table
    • Information about long-running transactions in a cluster
    • Information about operators in the actually executed plan
    • Information about the memory of all tenants
    • Information about statistics on real-time sessions of the process list
    • Information about the storage method of tables and indexes
    • Information about column NDVs of a table
    • Information about table indexes
  • Upgrade obdiag by using add-on files
  • Upgrade and uninstall obdiag
  • Telemetry Mode
  • FAQ
  • Release Notes
    • obdiag V3.3.0
    • obdiag V3.2.0
    • obdiag V3.1.0
    • obdiag V3.0.0
    • obdiag V2.6.0
    • obdiag V2.5.0
    • obdiag V2.4.0
    • obdiag V2.3.0
    • obdiag V2.2.0
    • obdiag V2.1.0
    • obdiag V2.0.0
    • obdiag V1.6.2
    • obdiag V1.6.1
    • obdiag V1.6.0
    • obdiag V1.5.2
    • obdiag V1.5.1
    • obdiag V1.5.0
    • obdiag V1.4.0
    • obdiag V1.3.0

Download PDF

Overview Install obdiag Configure obdiag Use obdiag to inspect an OceanBase cluster Inspection metrics obdiag gather log obdiag gather sysstat obdiag gather plan_monitor obdiag gather stack obdiag gather perf obdiag gather ash obdiag gather tabledump obdiag gather parameter obdiag gather variable obdiag gather clog/obdiag gather slog obdiag gather obproxy_log obdiag gather all Overview observer.base observer.backup observer.backup_clean observer.clog_disk_full observer.cluster_down observer.compaction observer.cpu_high observer.delay_of_primary_and_backup observer.io observer.log_archive observer.long_transaction observer.memory observer.perf_sql observer.px_collect_log observer.recovery observer.restart observer.rootservice_switch observer.suspend_transaction observer.unit_data_imbalance observer.perf_sql observer.topsql other.application_error obproxy.restart observer.unknown obdiag analyze log obdiag analyze flt_trace obdiag analyze parameter default obdiag analyze parameter diff obdiag analyze variable diff obdiag analyze index_space obdiag analyze memory obdiag analyze queue Use obdiag for root cause analysis disconnection major_hold lock_conflict ddl_disk_full clog_disk_full log_error ddl_failure index_ddl_error transaction_disconnection transaction_execute_timeout transaction_not_ending transaction_other_error transaction_rollback transaction_wait_timeout oms_full_trans oms_obcdc suspend_transaction Overview Basic information of a cluster Information about nodes in a cluster Information about units in a cluster Information about zones in a cluster RootService information of a cluster Information about tenants in a cluster Information about events in a cluster Information about locks in a cluster Information about top SQL statements in a cluster Information about slow SQL statements in a cluster Information about tables in a cluster Information about the process list in a tenant Information about the execution plan of an SQL statement Disk usage of a database Disk usage of the specified table in a database Information about all tenants in a cluster Information about CPU utilization of nodes in a cluster Internal table names fuzzy matched with the specified keyword Information about leaders in a cluster Information about locks on a table Information about long-running transactions in a cluster Information about operators in the actually executed plan Information about the memory of all tenants Information about statistics on real-time sessions of the process list Information about the storage method of tables and indexes Information about column NDVs of a table Information about table indexes Upgrade obdiag by using add-on files Upgrade and uninstall obdiag Telemetry Mode FAQ
OceanBase logo

The Unified Distributed Database for the AI 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 Diagnostic Tool
  3. V3.3.0
iconOceanBase Diagnostic Tool
V 3.3.0
  • V 3.3.0
  • V 3.2.0
  • V 3.1.0
  • V 3.0.0
  • V 2.6.0
  • V 2.5.0
  • V 2.4.0
  • V 2.3.0
  • V 1.5.0
  • V 1.4.0

Configure obdiag

Last Updated:2026-04-13 09:12:30  Updated
share
What is on this page
Prerequisites
Configuration methods
User-defined configuration file
--config option
System configuration file

folded

share

This topic describes the configuration files of OceanBase Diagnostic Tool (obdiag).

Note

We recommend that you use obd obdiag commands to quickly diagnose an OceanBase cluster deployed by using OceanBase Deployer (obd). In this case, no obdiag configuration file is required. For more information about the commands, see obdiag commands.

Prerequisites

You have installed obdiag. For more information, see Install obdiag.

Configuration methods

To configure obdiag, you can create a user-defined configuration file in a custom path, or use the system configuration file, which you do not need to modify in most cases. The following sections describe the two configuration files.

User-defined configuration file

You can create or edit a user-defined configuration file by running the obdiag config <option> command. By default, the configuration file is named config.yml and is stored in the ~/.obdiag directory. Template configuration files are stored in the ~/.obdiag/example directory.

obdiag config -h <db_host> -u <sys_user> [-p password] [-P port]

The following table describes the parameters.

Parameter Required Description
db_host Yes The IP address used to connect to the sys tenant of the OceanBase cluster.
sys_user Yes The username used to connect to the sys tenant of the OceanBase cluster. To avoid permission issues, we recommend that you use root@sys. If you connect to the cluster by using OceanBase Database Proxy (ODP), the value of this parameter must include the cluster name, such as root@sys#obtest.
-p password No The password used to connect to the sys tenant of the OceanBase cluster. This parameter is left empty by default.
-P port No The port used to connect to the sys tenant of the OceanBase cluster. Port 2881 is used by default.

Here are some examples:

# A password is specified.
obdiag config -hxx.xx.xx.xx -uroot@sys -p***** -P2881

# No password is specified.
obdiag config -hxx.xx.xx.xx -uroot@sys -P2881

# ODP is used for connection.
obdiag config -hxx.xx.xx.xx -uroot@sys#obtest  -p***** -P2883

After you run the obdiag config command, you need to enter related information as prompted.

#obdiag config -hxx.xx.xx.xx -uroot@sys -Pxxxx -p*****
2024-01-31 09:57:24,019 [INFO] Getting all the node information of the cluster, please wait a moment ...
Please enter the following configuration !!!
Enter your oceanbase host ssh username (default:''): test # The username for connecting to the host through SSH.
Enter your oceanbase host ssh password (default:''): ********* # The password for connecting to the host through SSH.
Enter your oceanbase host ssh_port (default:'22'): 22 # The SSH port number, which is 22 by default.
Enter your oceanbase install home_path (default:'/root/observer'): /home/admin/oceanbase # The installation path of OceanBase Database.
Enter your need config obproxy [y/N] (default:'N'): y # Specifies whether to use ODP for the diagnosed cluster.
Enter your obproxy server eg:'192.168.1.1;192.168.1.2;192.168.1.3' (default:''): xx.xx.xx.xx # The IP address of the ODP node.
Enter your obproxy host ssh username (default:''): test # The username for connecting to the ODP node through SSH.
Enter your obproxy host ssh password (default:''): ********* # The password for connecting to the ODP node through SSH.
Enter your obproxy host ssh port (default:'22'): 22  # The port number for connecting to the ODP node through SSH, which is 22 by default.
Enter your obproxy install home_path (default:'/root/obproxy'): /home/admin/obproxy # The installation path of ODP.
2024-01-31 09:59:23,109 [INFO] Node information has been rewritten to the configuration file /test/.obdiag/config.yml, and you can enjoy the journey !

Note

If you run the config command, you need to enter related information as prompted. Enter the values based on the actual situation.

After the execution is completed, the new configuration is generated in the config.yml configuration file, and the original configuration file, if it contains configuration information, is backed up to the ~/.obdiag directory as a backup_conf file.

The following sample code shows a complete configuration, which consists of three parts that can be configured as needed:

# Part 1: Parameters related to OceanBase Cloud Platform (OCP)
ocp:
  login:
    url: http://xx.xx.xx.xxx:xx
    user: ****
    password: ******
# Part 2: Parameters related to the OceanBase cluster
obcluster:
  ob_cluster_name: test # The cluster name.
  db_host: xx.xx.xx.1 # The IP address of the cluster.
  db_port: 2881 # The port number of the cluster, which is 2881 by default.
  tenant_sys: # The information of the sys tenant. To avoid permission issues, we recommend that you use root@sys.
    user: root@sys # By default, root@sys is used.
    password: ""
  servers:
    nodes:
      - ip: xx.xx.xx.1
      - ip: xx.xx.xx.2
      - ip: xx.xx.xx.3
    global:
      ssh_username: **** # The login information. We recommend that you use the same user information specified for the deployment of OceanBase Database.
      ssh_password: **** # If you do not use a password, set it to "".
      # ssh_port: 22 # The SSH port. By default, port 22 is used.
      # ssh_key_file: "" # The path of the SSH key. If you specify the ssh_password parameter, you do not need to specify this parameter.
      # ssh_type: remote # The deployment mode of OceanBase Database. Valid values: remote and docker. Default value: remote. Note that Kubernetes is not supported in docker mode.
      # container_name: xxx # The name of the OceanBase Database container. If you set the ssh_type parameter to docker, you must specify this parameter.
      
      # The installation directory of OceanBase Database. For example, if the path of the executable program of OceanBase Database is /root/observer/bin/observer,
      # you must set the home_path parameter to /root/observer.
      home_path: /root/observer   
      data_dir: /root/observer/store # The data disk path of OceanBase Database.
      redo_dir: /root/observer/store # The log disk path of OceanBase Database.
# Part 3: Parameters related to ODP
obproxy:
  obproxy_cluster_name: obproxy
  servers:
    nodes:
      - ip: xx.xx.xx.4
      - ip: xx.xx.xx.5
      - ip: xx.xx.xx.6
    global:
      ssh_username: **** # The login information. We recommend that you use the same user information specified for the deployment of ODP.
      ssh_password: **** # If you do not use a password, set it to "".
      # ssh_port: 22 # The SSH port. By default, port 22 is used.
      # ssh_key_file: "" # The path of the SSH key. If you specify the ssh_password parameter, you do not need to specify this parameter.
      # ssh_type: remote # The deployment mode of ODP. Valid values: remote and docker. Default value: remote. Note that Kubernetes is not supported in docker mode.
      # container_name: xxx # The name of the ODP container. If you set the ssh_type parameter to docker, you must specify this parameter.
      
      # The installation directory of ODP. For example, if the path of the executable program of ODP is /root/obproxy/bin/obproxy,
      # you must set the home_path parameter to /root/obproxy.
      home_path: /root/obproxy

Parameters of a specific node overrides those in the global section.

In the following sample configuration of an OceanBase cluster, parameters of each node are specified under the IP address of the node. If the same parameters are specified in the global section, parameters of each node take effect.

obcluster:
  ob_cluster_name: test
  db_host: xx.xx.xx.1
  db_port: 2881 # The port number of the cluster, which is 2881 by default.
  tenant_sys:
    user: root@sys # default root@sys
    password: ""
  servers:
    nodes:
      - ip: xx.xx.xx.1
        ssh_username: ****
        ssh_password: ****1
        home_path: /root/observer1
        data_dir: /root/observer/store1
        redo_dir: /root/observer/store1
      - ip: xx.xx.xx.2
        ssh_username: ****2
        ssh_password: ****2
        home_path: /root/observer2
        data_dir: /root/observer/store2
        redo_dir: /root/observer/store2
      - ip: xx.xx.xx.3
        ssh_username: ****3
        ssh_password: ****3
        home_path: /root/observer3
        data_dir: /root/observer/store3
        redo_dir: /root/observer/store3
    global:
      ssh_port: 22

Note

  • obdiag supports IPv6 addresses, such as ip: "xxxx:xxxx:xxx:xxxx:xxxx:xxxx:xxx:xxxx", since V3.2.0.

  • You can find more sample configuration files in the ~/.obdiag/example directory.

  • If your OceanBase cluster is deployed by using Docker, you can use the sample configuration file docker_ob_cluster.yml located in the ~/.obdiag/example directory.

  • If your OceanBase cluster is deployed in a Kubernetes environment by using ob-operator, you can use the sample configuration file operator.yml located in the ~/.obdiag/example directory.

--config option

obdiag V2.4.0 and later allow you to use the --config option to specify a user-defined configuration file. This way, you can use obdiag out of the box without a configuration file. This section describes how to use the --config option.

Note

  • You can specify multiple --config options in the format of --config key1=value1 --config key2=value2.
  • In the original config.yml configuration file stored in the ~/.obdiag directory, the [num] field appended to the obcluster.servers.nodes parameter indicates the information of a specific node, such as obcluster.servers.nodes[0].
  • In the original config.yml configuration file stored in the ~/.obdiag directory, the hierarchy is expressed by ..

Here are some sample configurations specified by --config options:

  --config ocp.login.url=http://xx.xx.xx.xxx:xx \
  --config ocp.login.user=**** \
  --config ocp.login.password=****** \
  --config obcluster.ob_cluster_name=test \
  --config obcluster.db_host=xx.xx.xx.1 \
  --config obcluster.db_port=2881 \
  --config obcluster.tenant_sys.user=root@sys \
  --config obcluster.tenant_sys.password="" \
  --config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
  --config obcluster.servers.nodes[1].ip=xx.xx.xx.2 \
  --config obcluster.servers.nodes[2].ip=xx.xx.xx.3 \
  --config obcluster.servers.global.ssh_username=**** \
  --config obcluster.servers.global.ssh_password=**** \
  --config obcluster.servers.global.ssh_port=22 \
  --config obcluster.servers.global.home_path=/root/observer \
  --config obcluster.servers.global.data_dir=/root/observer/store \
  --config obcluster.servers.global.redo_dir=/root/observer/store \
  --config obproxy.obproxy_cluster_name=obproxy \
  --config obproxy.servers.nodes[0].ip=xx.xx.xx.4 \
  --config obproxy.servers.nodes[1].ip=xx.xx.xx.5 \
  --config obproxy.servers.nodes[2].ip=xx.xx.xx.6 \
  --config obproxy.servers.global.ssh_username=**** \
  --config obproxy.servers.global.ssh_password=**** \
  --config obproxy.servers.global.ssh_port=22 \
  --config obproxy.servers.global.home_path=/root/obproxy

Here is an example of using an IPv6 address:

  --config obcluster.servers.nodes[0].ip="xxxx:xxxx:xxx:xxxx:xxxx:xxxx:xxx:xxxa"

You can simplify some parameter names in the preceding configurations. The following table describes the simplified parameter names supported by obdiag.

Simplified parameter name Full parameter name
db_host obcluster.db_host
db_port obcluster.db_port
tenant_sys.user obcluster.tenant_sys.user
tenant_sys.password obcluster.tenant_sys.password
ssh_username obcluster.servers.global.ssh_username
ssh_password obcluster.servers.global.ssh_password
ssh_port obcluster.servers.global.ssh_port
home_path obcluster.servers.global.home_path
obproxy_home_path obproxy.servers.global.home_path

System configuration file

The inner_config.yml configuration file is stored in the /usr/local/oceanbase-diagnostic-tool/conf directory.

obdiag:
  basic:
    config_path: ~/.obdiag/config.yml # The path of the user-defined configuration file.
    config_backup_dir: ~/.obdiag/backup_conf # The path where the backup of the original configuration file is stored when you run the obdiag config command.
    file_number_limit: 20 # The maximum number of files returned for a collection command on a single remote host.
    file_size_limit: 2G # The maximum size of a file returned for a collection command on a single remote host.
  logger:
    log_dir: ~/.obdiag/log # The path where the execution log file of obdiag is stored.
    log_filename: obdiag.log # The name of the execution log file of obdiag.
    file_handler_log_level: DEBUG # The lowest level of execution logs of obdiag to be recorded.
    log_level: INFO # The execution log level of obdiag.
    mode: obdiag
    stdout_handler_log_level: INFO # The lowest level of obdiag logs to be displayed.
check: # Parameters required for inspection. Usually, you do not need to modify parameters in this section.
  ignore_version: false # Specifies whether to ignore the version of OceanBase Database.
  report:
    report_path: "./check_report/" # The output path of the inspection report.
    export_type: table # The type of the inspection report.
  package_file: "~/.obdiag/check/observer_check_package.yaml" # The path of inspection package files.
  tasks_base_path: "~/.obdiag/check/tasks/" # The basic directory of inspection tasks.
gather:
  scenes_base_path: "~/.obdiag/gather/tasks" # The directory of gather tasks.
rca:
  result_path: "./rca/" # The storage path of root cause analysis results.

obdiag V2.4.0 and later allow you to use the --inner_config option to specify the system configuration file of obdiag. This section describes how to use the --inner_config option.

Note

  • You can specify multiple inner_config options in the format of --inner_config key1=value1 --inner_config key2=value2.
  • In the original inner_config.yml configuration file stored in the /usr/local/oceanbase-diagnostic-tool/conf directory, the hierarchy is expressed by ..

Here are some sample configurations specified by --inner_config options:

--inner_config obdiag.basic.file_number_limit=20
--inner_config obdiag.basic.file_size_limit=2G

Previous topic

Install obdiag
Last

Next topic

Use obdiag to inspect an OceanBase cluster
Next
What is on this page
Prerequisites
Configuration methods
User-defined configuration file
--config option
System configuration file