This article applies to the scenario of independent deployment of obdiag. Use the obdiag gather core command to collect the core files of the OceanBase cluster to which it belongs in one click.
If it is a cluster deployed by obd, you can directly collect information on the selected cluster through the obd side diagnostic command group.
Description
obdiag gather core command is new since obdiag V3.6.0.
Function description
The Core file is a memory snapshot file generated when the program crashes. It contains important debugging information such as the memory status and call stack when the program crashes. By collecting the core files of the OceanBase cluster, you can help analyze the reasons for program crashes and locate the root cause of the problem.
Attention
Core files are usually large and the collection process may take a long time. It is recommended to collect in an environment with good network conditions.
Instructions for use
obdiag gather core [options]
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| --from | No | string | Default is empty | The start time of core file collection, the format is: yyyy-mm-dd hh:mm:ss. |
| --to | No | string | Default is empty | The end time of core file collection, the format is: yyyy-mm-dd hh:mm:ss. |
| --since | No | string | 30m |
A certain period of time collected by core files, the format is: <n><m|h|d>, where n represents the time number to be entered, m represents minutes, h represents hours, and d represents days, such as 30m represents the last 30 minutes. |
| --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. Fixed style: --inner_config key1=value1 --inner_config key2=value2.
ExplanationThe parameters that support configuration through this option can be found in the obdiag configuration in the System configuration file (obdiag's own configuration) section. |
| --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 the User-side configuration file section of 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 core \
--config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
--config obcluster.servers.nodes[1].ip=xx.xx.xx.2 \
--config obcluster.servers.global.ssh_username=test \
--config obcluster.servers.global.ssh_password=****** \
```* The collected nodes are configured with password-free settings
```bash
obdiag gather core \
--config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
--config obcluster.servers.nodes[1].ip=xx.xx.xx.2
```* The account and password for ssh login of the collected nodes are different.
```bash
obdiag gather core \
--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[1].ip=xx.xx.xx.2 \
--config obcluster.servers.nodes[1].ssh_username=test2 \
--config obcluster.servers.nodes[1].ssh_password=******
```* 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 about all nodes in the cluster.
```bash
obdiag gather core \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=***
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 (default path ~/.obdiag/config.yml). For related detailed configuration introduction, see the User-side configuration file section in obdiag configuration.
obdiag gather core
Interpretation of results
After the command is executed, a result folder will be generated in the specified directory. The folder shape is: ./obdiag_gather_pack_xxxxx. The folder contains the collected observer core files.
