DEV Community

Qing
Qing

Posted on

DBMind Mode-service

This subcommand can be used to initialize the configuration directory and start and stop background tasks.

Initializing the Configuration Directory

You can run the gs_dbmind service setup subcommand to initialize the configuration directory. This directory may contain the configuration files and logs of the DBMind. Some files in the directory are described as follows:

· dbmind.conf: DBMind parameter configuration file. You can modify it using the gs_dbmind set command or a text editor.

· dynamic_config.db: DBMind service metadata stored on the local node, including algorithm hyperparameters and monitoring thresholds. This file contains DBMind service metadata and cannot be configured by users.

· metric_map.conf: monitoring metric mapping table, which can be used to adapt to different collection platforms. For example, in DBMind, the monitored system CPU usage is named os_cpu_usage, but a user-defined collection tool may name the CPU usage my_cpu_usage_rate. In this case, if you want DBMind to represent the CPU usage metric my_cpu_usage_rate, you need to modify this configuration item. That is, add the os_cpu_usage = my_cpu_usage_rate configuration item for mapping. For common users, you are advised to use the collection component and solution of the DBMind. In this case, you do not need to modify the configuration file.

· logs: This directory stores logs generated by the DBMind service.

You can initialize the configuration directory in interactive or non-interactive mode. For example, if the name of the configuration directory to be initialized is confpath, perform the following operations:

Interactive mode

Image description

After running the preceding command, you can configure the configuration items in interactive mode through the CLI client.

Non-interactive mode

In non-interactive mode, the initialization consists of three steps: starting configuration, modifying configuration items, and initializing configuration. In the second step, you need to manually edit the configuration file by using the text editor. The procedure is as follows:

  1. Run the following command to start the configuration:

Image description

  1. After manually modifying the preceding parameters, initialize the configuration items. In this phase, DBMind preliminarily checks the correctness of configuration items, initializes the structure and content of the metadata database table for storing result data, and encrypts the plaintext passwords in the configuration items.

Image description

  1. Start the DBMind background service based on the configuration directory.

Image description

Starting a Service
After the configuration directory is initialized, you can start the DBMind background service based on the configuration directory. For example, if the configuration directory is confpath, run the following command:

Image description

After the preceding command is executed, the system displays a message indicating that the service has been started. If no additional parameter is specified, this command starts all background tasks by default. If you want to start only one background task, add the –only-run option. For example, if you only want to start the slow SQL root cause analysis service, run the following command:

Image description

Stopping a Service
Similar to starting a service, stopping a service has a simpler command line structure. You only need to specify the address of the configuration directory. For example, if the configuration directory is confpath, run the following command:

Image description

The DBMind service automatically exits after the running task is complete in the background.

Image description

Command Reference
You can use the –help option to obtain the help information about this mode. For example:

Image description

Table 1 Parameters of the gs_dbmind service subcommand

Image description

Top comments (0)