windows下prometheus+mysqld_exporter+granafa监控mysql

安装mysqld_exporter

去官网下载对应版本:https://prometheus.io/download/

创建my.cnf文件

[client]
host=127.0.0.1
port=3306
user=root
password=root

创建 start.bat

mysqld_exporter.exe --config.my-cnf=my.cnf

访问:http://127.0.0.1:9104/metrics

修改prometheus.yml,加入任务,之后重启prometheus

  - job_name: 'mysql_metrics_localhost'
    static_configs:
    - targets: ['localhost:9104']

在grafana中,导入模版 id:12826

posted @ 2021-02-24 20:57  dkn  阅读(668)  评论(0编辑  收藏  举报