前言前面的一篇文章已经介绍了 docker-compose 搭建 Prometheus + Grafana 服务。当时实现了监控服务器指标数据,是通过 node_exporter。Prometheus 还可用来监控很多服务,比如常见的 MySQL。本文就介绍如何通过 mysqld_exporter 来监控 MySQL 指标。下载安装包12345cd /optwget https://github.com/prometheus/mysqld_exporter/releases/download/v0.14.0/mysqld_exporter-0.14.0.linux-amd64.tar.gztar xvf mysqld_exporter-0.14.0.linux-amd64.tar.gzmv mysqld_exporter-0.14.0.linux-amd64 mysqld_exportermv /opt/mysqld_exporter /usr/local/创建监控账号并授权在需要监控的 mysql 上创建账号并授权。1234# 创建用户CREATE USER'prometheus'@'%'IDENTIFIED BY'prometheus';# 分配权限GRANT PROCESS, REPLICATION CLIENT,
...
继续阅读
(8)