This article applies to the scenario of independent deployment of obdiag. Use the obdiag gather perf command to collect the perf information (flame graph/bianque graph) of the OceanBase cluster to which it belongs in one click.
Description
Since obdiag V4.2.0, when there is an OBProxy node in the configuration, the perf data of the OceanBase cluster and OBProxy can be collected together; the OBProxy node in the Docker/Kubernetes environment will be automatically skipped.
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 perf [options]
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| --scope | No | string | all | Used to selectively collect specified perf information, configurable values are sample, flame, pstack, all. When flame or all is selected, if the flamegraph.pl and stackcollapse-perf.pl scripts exist in the dependencies/bin directory, the flame graph SVG file (flame.svg) will be automatically generated and packaged into the result. |
| --count | No | int | 100000000 | perf event sampling period, needs to be >= 1000000. |
| --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 perf
The output is as follows:
Gather Perf Summary:
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
| Node | Status | Size | Time | PackPath |
+===================+===========+==========+========+======================================================================+
| xxx.xxx.xxx.xxx | Completed | 368.178K | 90 s | gather_pack_20230117140836/perf_xxx.xxx.xxx.xxx_20230117140836.zip |
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
| xxx.xxx.xxx.xxx | Completed | 368.178K | 90 s | gather_pack_20230117140836/perf_xxx.xxx.xxx.xxx_20230117140836.zip |
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
```* The collected nodes are configured with password-free settings
```bash
obdiag gather perf \
--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 perf \
--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 perf \
--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 perf
