整体思路
1、官网下载promethus 、mysqld_exporter、grafana软件压缩包
2、配置mysqld_exporter,启动mysqld_exporter。(主要是mysql用户配置,这里使用了root用户,可以专门建立用户控制授权)
3、promethus 中配置mysqld_exporter,启动promethus (直接启动nssm非必须)
4、grafana中配置数据源(promethus 地址)
5、grafana中选择监控dashboard(有模板,7362为mysql模板)
6、查看监控效果
下载地址
官网下载软件
promethus 和 mysqld_exporter
https://prometheus.io/download/
mysqld_exporter
grafana
https://grafana.com/grafana/download?platform=windows
控制台地址
promethus控制台地址
http://localhost:9090/
mysqld_exporter
http://localhost:9104/
grafana 控制台地址
http://localhost:3000/
直接启动
注意的点
1、mysqld_exporter下载压缩包里默认没有 .my.cnf文件(注意前面有点)
需要手动创建
[client]
host=127.0.0.1
user=root
password=123456
promethus中prometheus.yml配置添加
- job_name: 'mysql'
static_configs:
- targets: ['localhost:9104']
labels:
instance: datav
Grafana添加数据源、配置dashboard略
最终效果