This topic describes how to use OceanBase Diagnostic Tool (obdiag) that is independently deployed to collect and display the information about events in a cluster in a terminal.
Syntax
obdiag display scene run --scene=observer.event [options]
The following table describes the options.
| Option | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| -c | No | string | ~/.obdiag/config.yml |
The path of the configuration file. |
| --inner_config | No | string | Empty | The configurations of obdiag. |
| --config | No | string | Empty | The configurations of the cluster diagnosed by obdiag, in the format of --config key1=value1 --config key2=value2. |
| --env | No | string | Empty | Additional parameters required for the obdiag display command, in the format of --env db_connect='-h127.0.0.1 -P2881 -utest@test -p****** -Dtest'. |
Note
In the --env option, db_connect='-h127.0.0.1 -P2881 -utest@test -p****** -Dxxxx' indicates the connection string of the business tenant.
Examples
Method 1: Use obdiag out-of-the-box without a configuration file
Note
For more information about the parameters used in the command in this section, see Configure obdiag.
obdiag display scene run --scene=observer.event --env db_connect='-h127.0.0.1 -P2881 -utest@test -p****** -Dtest' \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=***
Method 2: Use obdiag with a configuration file
Before you use obdiag, make sure that you have configured the login information of the target nodes in the config.yml configuration file of obdiag. For more information, see Configure obdiag.
obdiag display scene run --scene=observer.event --env db_connect='-h127.0.0.1 -P2881 -utest@test -p****** -Dtest'
Results
After the command is executed, the execution result is displayed in the current terminal.
# The --env option is passed to specify the connection string of the tenant whose events are to be queried.
$ obdiag display scene run --scene=observer.event --env db_connect='-h127.0.0.1 -P2881 -utest@test -p****** -Dtest'
display_scenes_run start ...
execute tasks: observer.event
+-----------+-------------+-------------+----------------+
| tenant_id | event_group | total_waits | time_waited |
+-----------+-------------+-------------+----------------+
| 1004 | IO | 1317 | 0.3403 |
| 1004 | LATCH | 9 | 0.0210 |
| 1004 | OTHER | 13133760614 | 192831577.5354 |
| 1004 | SYNC_RPC | 10 | 0.4839 |
+-----------+-------------+-------------+----------------+
Trace ID: a7d52e6c-8a21-11ef-9c0c-00163e01c7ce
# The --env option is not passed to specify the connection string of the tenant whose events are to be queries. By default, events of all tenants are queried from the sys tenant.
$ obdiag display scene run --scene=observer.event
display_scenes_run start ...
execute tasks: observer.event
+-----------+-------------+-------------+-----------------+
| tenant_id | event_group | total_waits | time_waited |
+-----------+-------------+-------------+-----------------+
| 1 | IO | 44587295 | 11819.3514 |
| 1 | LATCH | 1295053 | 659.6709 |
| 1 | OTHER | 92085353274 | 6534582056.4494 |
| 1 | SYNC_RPC | 5540293 | 1249.4767 |
| 1001 | IO | 60033 | 94.8533 |
| 1001 | LATCH | 6 | 0.0001 |
| 1001 | OTHER | 6151720013 | 61681531.5895 |
| 1002 | IO | 2556 | 0.6016 |
| 1002 | LATCH | 68 | 0.0210 |
| 1002 | OTHER | 24609163095 | 308435416.1026 |
| 1002 | SYNC_RPC | 265 | 17.6485 |
| 1003 | IO | 65408 | 101.2256 |
| 1003 | LATCH | 4 | 0.0001 |
| 1003 | OTHER | 6151653089 | 61681266.9859 |
| 1004 | IO | 1317 | 0.3403 |
| 1004 | LATCH | 9 | 0.0210 |
| 1004 | OTHER | 13134123289 | 192836906.3609 |
| 1004 | SYNC_RPC | 10 | 0.4839 |
+-----------+-------------+-------------+-----------------+
Trace ID: 26ed7dda-8a22-11ef-945a-00163e01c7ce