DBSExporter is an add-on designed for monitoring PostgreSQL, MongoDB, RabbitMQ, Redis, and S3 storage databases.
The installation of the add-on consists of the following steps:
- Download the Helm chart and configuration file.
- Create a configuration token to use MinIO metrics for Prometheus.
- Fill in the configuration file.
- Install Node Exporter on the database servers.
- Install the DBSExporter chart using Helm in the Kubernetes cluster.
Step 1: Download the Helm chart and configuration file
To install via the internet, obtain the values-dbsexporter.yaml
configuration file by executing the following command:
helm repo add elma365 https://charts.elma365.tech
helm repo update
helm show values elma365/dbsexporter > values-dbsexporter.yaml
For offline installation without internet access
helm repo add elma365 https://charts.elma365.tech
tar -xf dbsexporter-X.Y.Z.tgz |
Step 2: Create a configuration token to use MinIO metrics for Prometheus
Create alias
and send the command to generate a token by executing the following:
mc alias set my_alias http://minio.local accessKey secretKey
mc admin prometheus generate my_alias
Step 3: Fill in the configuration file
Fill in the configuration file to install DBSExporter
|
prometheus-minio-exporter: Where repository format is: address — |
You can add the following additional settings in the values-dbsexporter.yaml
configuration file:
- Connect several databases both internal and external to DBSExporter. To do this, duplicate the parameters of the
instances
block and configure the connection parameters for each replica. For example:
instances:
- name: mongodb-1
uri: "mongodb://mongodb-1:27017"
- name: mongodb-2
uri: "mongodb://mongodb-2:27017"
- Enable Yandex Cloud metrics collection.
Collection of Yandex Cloud metrics is a chargeable service. Read more in the official documentation of the service.
Example of how to enable Yandex Cloud metrics collection:
global:
# Export yandex metrics
yandexExporter:
enabled: true
bearerToken: "your_bearerToken"
folderId: "your_folderId"
services: ["managed-mongodb", "managed-postgresql"]
relabelings: {}
- Connect Deckhouse with DBSExporter. For example:
global:
provisioner: "deckhouse"
Step 4: Install Node Exporter on the database servers
To monitor database servers, install Node Exporter. For this:
- Download Node Exporter on the database server:
wget https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz
- Unpack the archive downloaded on the previous step:
tar xvf node_exporter-1.8.2.linux-amd64.tar.gz && cd node_exporter-1.8.2.linux-amd64
- Copy the
node_exporter
file:
sudo cp node_exporter /usr/local/bin/
- Create a user for Node Exporter:
sudo useradd --no-create-home --shell /bin/false nodeusr
- Define the owner for the
node_exporter
executable file:
sudo chown -R nodeusr:nodeusr /usr/local/bin/node_exporter;
- Create the
node_exporter.service
file to launch Node Exporter as a service:
cat <<EOF | sudo tee /etc/systemd/system/node_exporter.service;
[Unit]
Description=NodeExporter
[Service]
TimeoutStartSec=0
User=nodeusr
ExecStart=/usr/local/bin/node_exporter \
--web.listen-address=:9100
[Install]
WantedBy=multi-user.target
EOF
- Reload
systemd
configuration:
sudo systemctl daemon-reload
- Launch the
node_exporter.service
service:
sudo systemctl enable --now node_exporter.service
After installing Node Exporter, fill in the parameters in the values-dbsexporter.yaml
configuration file to monitor the database servers. In this case, host addresses will be extracted from the instances
points of the configuration file. Example of how to set the parameters:
# Settings of node exporter
nodeExporter:
enabled: true
port: 9100
relabelings: {}
Step 5: Install the DBSExporter chart using Helm in the Kubernetes cluster
Execute the installation of the DBSExporter chart in namespace monitoring
.
For online installation:
helm upgrade --install -n monitoring dbsexporter elma365/dbsexporter -f values-dbsexporter.yaml
For offline installation without internet access, navigate to the directory with the downloaded chart and execute the command:
helm upgrade --install dbsexporter ./dbsexporter -f values-dbsexporter.yaml -n monitoring