This topic describes the configuration file of OceanBase Diagnostic Tool (obdiag).
Prerequisites
You have installed obdiag. For more information, see Install obdiag.
Configuration description
All configurations are saved in the config.yml file under the {obdiag_install_path}/conf/ directory. The default path of the configuration file is /usr/local/oceanbase-diagnostic-tool/conf/config.yml. Modify the configuration file directly.
The configurations can be divided into four sections.
# Configuration section 1: Configure obdiag information in this section, including logs and external variables of obdiag.
OBDIAG:
BASIC:
config_backup_dir: /tmp/oceanbase-diagnostic-tool/conf # The directory where historical configuration files are located. The config.yml file is overwritten when a configuration file is quickly generated. A copy of the configuration file is saved each time the configurations are updated so that you can query earlier configurations.
file_number_limit: 20 # The maximum number of files allowed to be returned by a single OBServer node during the collection of logs of OceanBase Database.
file_size_limit: 2G # The maximum size of files allowed to be returned in a batch during the collection of logs of OceanBase Database.
LOGGER: # The logging configuration of obdiag.
file_handler_log_level: DEBUG # The level of logs recorded in log files.
log_dir: /tmp/oceanbase-diagnostic-tool/log # The path where obdiag logs are stored.
log_filename: odt.log # The name of the log file of obdiag.
log_level: INFO # The log printing level of obdiag.
mode: obdiag
stdout_handler_log_level: DEBUG
# Configuration section 2: Configure OCP information in this section if your OceanBase cluster is managed by an OCP cluster. Otherwise, skip this step.
OCP:
LOGIN: # The logon information of OCP.
password: xxxx
url: http://xxx.xxx.xxx.xxx:xxxx
user: xxx
METADB:
dbname: xxx
ip: xxx.xxx.xxx.xxx
password: xxxx
port: xxx
user: xxx
# Configuration section 3: Configure the connection information of the OceanBase cluster whose information is to be collected. If you do not need to use the gather plan_monitor command, skip this step.
OBCLUSTER:
cluster_name: xxx
host: xxx.xxx.xxx.xxx
password: xxx
port: xxx
user: xxx
# Configuration section 4: Configure the logon information of the node whose information is to be collected.
NODES:
- ip: xxx.xxx.xxx.xxx
port: xxx
user: xxx
password: xxx
private_key: xxx
home_path: xxx # The installation directory of OceanBase Database.
CHECK: # The configurations required for inspection. In general scenarios, you do not need to change the configurations.
ignore_obversion: false
report:
report_path: "./check_report/" # The output path of the inspection report.
export_type: table # The output type of the inspection report.
package_file: "~/.obdiag/check_package.yaml" # The path of the inspection package file.
tasks_base_path: "~/.obdiag/tasks/" # The base directory of the inspection task.
Configure relevant information in the preceding configuration sections based on the actual situation. The configurations of obdiag are seldom modified, and those of other configuration sections can be modified as needed.
If your OceanBase cluster is managed by an OCP cluster and you want to collect the information of all OBServer nodes in the cluster, you can run the obdiag config command to quickly generate the configurations of these nodes. The syntax is as follows:
obdiag config --cluster_name cluster_name --cluster_id cluster_id
Example: obdiag config --cluster_name demo1 --cluster_id 1
The following table describes the options.
Option |
Required? |
Description |
|---|---|---|
| -h | No | The help information. |
| --cluster_name | Yes | The name of the OceanBase cluster displayed on the GUI of the OCP console. |
| --cluster_id | Yes | The ID of the OceanBase cluster displayed on the GUI of the OCP console. |
Note
- Before you use the
./obdiag configcommand, make sure that you have completed the configurations in configuration section 2. - After you execute the
./obdiag config --cluster_name cluster_name --cluster_id cluster_idcommand, an interaction page appears for you to select nodes whose information is to be collected. You can press the Up or Down key to move the asterisk (*) to the node whose information you want to collect, press the Space key to select the node, and press Enter to quickly obtain configurations. - You must select at least one node.
press SPACE to mark, ENTER to continue
xxx.xxx.xxx.11
xxx.xxx.xxx.12
* xxx.xxx.xxx.13
xxx.xxx.xxx.14
After the command is executed, the configurations of the NODES section in the config.yml file located in the conf directory are updated, and the list of nodes whose information is to be collected is displayed.
