This article applies to the scenario of independent deployment of obdiag. Use the obdiag gather sysstat command to collect host information of the OceanBase cluster (host dmesg information, host CPU information, host memory information) with 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.
Instructions for use
obdiag gather sysstat [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 sysstat \
--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 output is as follows:
Summary:
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------------+
| Node | Status | Size | Time | PackPath |
+===================+===========+=========+========+================================================================================+
| xxx.xxx.xxx.xxx | Completed | 45.209K | 5 s | obdiag_gather_pack_20220729164233/sysstat_xxx.xxx.xxx.xxx_20220729164233.zip |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx | Completed | 42.170K | 5 s | obdiag_gather_pack_20220729164233/sysstat_xxx.xxx.xxx.xxx_20220729164233.zip |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------------+
```* The collected nodes are configured with password-free settings
```bash
obdiag gather sysstat \
--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 sysstat \
--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 on all nodes in the cluster
```bash
obdiag gather sysstat \
--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 config.yml. For related detailed configuration introduction, see obdiag configuration.
obdiag gather sysstat
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
The content collected from different nodes in the folder is compressed into a zip file. The result after decompression is as follows
#tree
.
├── dmesg.human.current # Host dmesg
├── one_day_cpu_data.txt # Last-day CPU from tsar on target
├── one_day_mem_data.txt # Last-day memory from tsar on target
├── tsar_io_data.txt # IO stats from tsar on target
├── tsar_swap_data.txt # Swap stats from tsar on target
├── tsar_tcp_udp_data.txt # TCP/UDP stats from tsar on target
└── tsar_traffic_data.txt # Traffic stats from tsar on target
