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

V1.5.0
  • Overview
  • Install obdiag
  • Configure obdiag
  • Clustor monitor
    • Use obdiag to inspect an OceanBase cluster
    • Inspection metrics
  • Use obdiag to collect information
  • Use obdiag for diagnostic analysis
  • Telemetry mode
  • FAQ
  • Relase note
    • obdiag V1.5.0
    • obdiag V1.4.0
    • obdiag V1.3.0

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Diagnostic Tool
  3. V1.5.0

Configure obdiag

Last Updated:2026-09-04 08:22:11

Prerequisites
Configuration description
User-defined configuration file
System configuration file

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

Prerequisites

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

Configuration description

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'.
-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 of 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 -p"" -P2881

Note

If you run the config command, you need to enter the information as prompted in interactive mode.

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 default port 2881.
  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 logon information. We recommend that you use the same user information specified for the deployment of OBServer nodes.
      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 OBServer nodes. Valid values: remote and docker. Default value: remote. Note that Kubernetes is not supported in docker mode.
      # container_name: xxx # The name of the OBServer container. If you set the ssh_type parameter to docker, you must specify this parameter.

      # The installation directory of OBServer. For example, if the path of the executable program of OBServer 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 path of the OBServer data disk. The default path is ${home_path}/store, which is the same as the value of the parameter with the same name in OceanBase Deployer (OBD).
      # redo_dir: /root/observer/store # The path of the OBServer log disk. The default path is ${home_path}/store, which is the same as the value of the parameter with the same name in OBD.
# Part 3: Parameters related to OceanBase Database Proxy (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 logon 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 overwrites 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 default port 2881.
  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

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

System configuration file

The system configuration file inner_config.yml 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_package.yaml" # The path of the inspection package file.
  tasks_base_path: "~/.obdiag/tasks/" # The basic directory of inspection tasks.

Previous topic

Install obdiag
Last

Next topic

Use obdiag to inspect an OceanBase cluster
Next
on this page
Prerequisites
Configuration description
User-defined configuration file
System configuration file