mysql-exporter
Table of Contents
Preface
Building a monitoring system with Prometheus + Grafana.
This article covers monitoring MySQL.
Steps
Modify MySQL Exporter Config File
[client]
user=exporter
password=xxx
host=172.31.44.128
port=3306
database=mysql
Install MySQL Exporter
docker run -d \
--name mysqld_exporter \
-p 9104:9104 \
-v /home/ec2-user/prometheus-mysql-exporter.cnf:/.my.cnf \
docker_url
Grant MySQL Permissions
CREATE USER 'exporter'@'localhost' IDENTIFIED BY 'XXXXXXXX' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'localhost';
Modify Prometheus Config File
- job_name: 'mysql'
static_configs:
- targets: ['172.31.44.128:9104']
labels:
instance: 'mysql-server-test'
Add Grafana Dashboard
Add a MySQL monitoring dashboard in Grafana.
Related Articles
redis-exporter
Setting up Redis monitoring with Prometheus and Grafana using redis-exporter — installation, Prometheus config, and Grafana dashboard setup.
JumpServer
Preface: JumpServer is a popular open-source bastion host. If you have many servers to manage and need security auditing, JumpServer is a great choice. This article covers installation, configuration, and basic usage.
prometheus+grafana
Setting up a monitoring system with Prometheus and Grafana — covering Prometheus server, node-exporter, Grafana dashboard configuration, and Docker deployment.
docker-nginx
Preface There are many Docker images for nginx. This article packages a business nginx into a Docker image. Choosing the nginx version alpine Alpine is a minimal Linux distribution, with an image size of only 7.73M. nginx also has an alpine-based version. This article uses the alpine-based version. stable ngi
Docker Private Registry
Preface After becoming proficient with Docker locally, the next step is to push local Docker images to a remote registry for easy access elsewhere. Common commands The previous section covered common Docker commands, see: https://blog.insistime.com/dockercmds Official Docker Hub Docker offici