This article applies to the scenario of independent deployment of obdiag. Use the obdiag gather stack command to collect stack information of the OceanBase cluster to which it belongs in one click. This collection item does not currently support the collection of stack information of the ARM version of OceanBase cluster.
If it is a cluster deployed by obd, you can directly collect information on the selected cluster through the obd side diagnostic command group.
Instructions for use
obdiag gather stack [options]
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| --store_dir | No | string | Defaults to the current path where the command is executed | The local path where the results are stored. |
| -c | No | string | ~/.obdiag/config.yml |
Configuration file path. |
| --inner_config | No | string | Default is empty | obdiag's own configuration. |
| --config | No | string | Default is empty | Configuration of the cluster to be diagnosed by obdiag, fixed style: --config key1=value1 --config key2=value2.
ExplanationThe parameters that support configuration through this option can be found in obdiag configuration. |
| --config_password | No | string | Default is empty | obdiag When using an encrypted configuration file, you need to pass in the corresponding password through this option.
ExplanationFor details, see Configuration file encryption. |
Usage example
Method 1: Use without configuration file (out of the box)
obdiag gather stack \
--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.home_path=/home/admin/oceanbase
The output is as follows:
Summary:
+-------------------+-----------+---------+--------+---------------------------------------------------------------------------------+
| Node | Status | Size | Time | PackPath |
+===================+===========+=========+========+=================================================================================+
| xxx.xxx.xxx.xxx | Completed | 19.926K | 10 s | obdiag_gather_pack_20220729163951/obstack2_xxx.xxx.xxx.xxx_20220729163951.zip |
+-------------------+-----------+---------+--------+---------------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx | Completed | 22.803K | 12 s | obdiag_gather_pack_20220729163951/obstack2_xxx.xxx.xxx.xxx_20220729163951.zip |
+-------------------+-----------+---------+--------+---------------------------------------------------------------------------------+
```* The collected nodes are configured with password-free settings
```bash
obdiag gather stack \
--config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
--config obcluster.servers.nodes[1].ip=xx.xx.xx.2 \
--config obcluster.servers.global.home_path=/home/admin/oceanbase
```* The account and password for ssh login of the collected nodes are different.
```bash
obdiag gather stack \
--config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
--config obcluster.servers.nodes[0].ssh_username=test1 \
--config obcluster.servers.nodes[0].ssh_password=****** \
--config obcluster.servers.nodes[0].home_path=/home/test2/oceanbase
--config obcluster.servers.nodes[1].ip=xx.xx.xx.2
--config obcluster.servers.nodes[1].ssh_username=test2 \
--config obcluster.servers.nodes[1].ssh_password=****** \
--config obcluster.servers.nodes[1].home_path=/home/test2/oceanbase
```* Provide the connection information of the sys tenant and let obdiag automatically help you obtain the IP addresses of each node in the cluster and collect information on all nodes in the cluster
```bash
obdiag gather stack \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=*** \
--config obcluster.servers.global.home_path=/home/admin/oceanbase
Method 2: Use with configuration file
You need to ensure that the login information of the node to be collected has been configured in the obdiag configuration file config.yml. For related detailed configuration introduction, see obdiag configuration.
obdiag gather stack
Interpretation of results
After the command is executed, a folder will be generated in the specified directory. The folder shape is: obdiag_gather_pack_20240808105846
Features
Small blocking window, average thread blocking time < 1ms
High efficiency, results with complete line numbers can usually be output within a few seconds
Support parsing dynamic library function names
Support stack aggregation
Support specifying binary and debuginfo paths
Support catching independent threads
