Components that Support DBMind-Prometheus Exporter-Environment Deployment
Tags: opengauss
Published: 2023-04-12 09:09:53

**Environment Deployment**
1. You can download Prometheus-server and node-exporter from the Prometheus official website and start them according to the official documents. You can also use the quick deployment tool provided by DBMind to deploy them. If you deploy the software by yourself, go to 3.

2. Use the CLI to quickly deploy Prometheus and all exporters. For the first installation, ensure that the network connection is available. The input parameter is **–online**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fcw8qyj47fjzm5rbf672.png)

After an online deployment is successfully performed, you can set this parameter to **–offline** to perform offline deployment.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4pjl0br7r12aqz5jz57w.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdm3pzp7stwmta0m0ssk.png)

If one-click deployment is used, the download path and decompression path of the Prometheus and node_exporter software packages are in the $HOME directory.

3. During the deployment, to ensure that the deployment location is correct and the subsequent running and monitoring are normal, the program requires users to interactively enter some parameters. The listening IP address of Prometheus and node-exporter is 0.0.0.0 by default. Prometheus and node-exporter are open-source software, and DBMind cannot obtain the IP address to be bound. Therefore, you need to configure the IP address. During the installation, however, the DBMind prompts the user to bind the listening address to a specific IP address. The following is an example of the configuration file of the deployment tool. The tool performs interactive configuration. You are not advised to manually modify the configuration file. The configuration file is as follows:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c55e20ndgavbbd81ug4c.png)

[DOWNLOADING] contains the address for downloading the software package, version name of the software installation package, and integrity verification code of the software installation package. This part is not included in the interactive input range.

The Prometheus and reprocessing_exporter are deployed together on the main control device. The number of devices is 1. The parameters related to this device are classified as [PROMETHEUS].

node_exporter and opengauss_exporter are deployed together on the device where the database is located. Multiple devices may exist. The parameters related to these devices are classified as [EXPORTERS]. The usernames and passwords of these database nodes must be the same as those of the database nodes. The deployment paths and SSL certificate paths must also be the same.

The **Targets** option of [EXPORTERS] indicates the monitored database instance objects. The format is IP address**:**Port number**/**DB name. Multiple database instances are separated by commas (,). Currently, the IP address is strongly verified, and the domain name cannot be entered.

For SSL certificate management, Prometheus does not support private key files that contain passwords. Therefore, the one-click deployment function does not support private key files that contain passwords on Prometheus.

You need to place the certificate files required by [PROMETHEUS] and [EXPORTERS] in the same path on each node in advance. If multiple nodes are deployed, the certificate file paths on different nodes must be the same. If the path is incorrect and no certificate file is detected during the running of each component, an alarm is generated and the component exits.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iymddas2cfifc8a092zx.png)

You can run the –help command to obtain help information.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qy5ur62fpslzmeekp40i.png)

When the **-c –conf** parameter is used, the location of the configuration file to be read is specified. {CONFIG_PATH} in CONF varies according to the actual installation path.

4. After automatic deployment, the prometheus.yaml configuration file is automatically generated based on the parameters entered during the configuration. The configuration file is automatically loaded when Prometheus is started. The following is an example:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgwajtmx1nre5p3k8qdl.png)

After the deployment is complete, the program is distributed to all target locations and can run automatically. For details, see the next section.

The exporter component uses HTTPS for communication by default. 

Therefore, you need to provide the SSL certificate and key file by default through **–ssl-keyfile**, **–ssl-certfile**, and **–ssl-ca-file**. To disable HTTPS, you can run the –disable-https command.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07kxeps42a7f8de1wmn7.png)