This article is applicable to the scenario of independent deployment of obdiag. It can retrieve the troubleshooting information needed to troubleshoot PX error problems with one click, solving the pain point of difficulty in retrieving distributed node information.
Instructions for use
obdiag gather scene run --scene=observer.px_collect_log [options]
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| --scene | Yes | string | Default is empty | Scene name, you can use obdiag gather scene list to see which scenes the current version supports |
| --env | Yes | string | Default is empty | This scenario requires additional parameters to support, which can be configured through --env. Supports specifying the key=value format multiple times, for example: --env trace_id=Yxx --env estimated_time="2024-08-08 23:17:59". |
| --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. |
| --temp_dir | No | string | /tmp |
The temporary file storage directory generated by the remote node during the log collection process. |
| --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)
# PX SQL errors: collect last 30m by default when no extra args
obdiag gather scene run --scene=observer.px_collect_log \
--env trace_id=Yxx --env estimated_time="2024-08-08 23:17:59" \
--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.ssh_username=test \
--config obcluster.servers.global.ssh_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.
# PX SQL errors: collect last 30m by default when no extra args
obdiag gather scene run --scene=observer.px_collect_log \
--env trace_id=Yxx --env estimated_time="2024-08-08 23:17:59"
Interpretation of results
After the command is executed, a folder will be generated in the specified directory. The folder looks like: obdiag_gather_pack_20240808105846
# tree
.
├── ob_log_xx.xx.xx.xx_20240611190059_20240611193159.zip # PX error source node logs
├── result_summary.txt
Practical cases
Case: A user encounters a PX error problem and needs to troubleshoot. Directly execute the following command to package the information required for diagnosis and send it to the community forum or frontline support staff.
obdiag gather scene run --scene=observer.px_collect_log \
--env trace_id=Yxx --env estimated_time="2024-08-08 23:17:59" \
--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.ssh_username=test \
--config obcluster.servers.global.ssh_password=****** \
--config obcluster.servers.global.home_path=/home/admin/oceanbase
