使用Prometheus和Grafana进行Mysql监控

时间:2017-09-05 11:45:41

标签: grafana prometheus

我需要使用Prometheus和Grafana来监控Mysql;

在客户端服务器中添加了mysqld导出器

在客户端服务器中启动mysqld时报告为:

time="2017-09-05T11:42:53Z" level=info msg="Error scraping slave state: dial tcp [::1]:3306: getsockopt: connection refused" file="mysqld_exporter.go" line=824
time="2017-09-05T11:42:53Z" level=info msg="Error scraping table schema: dial tcp [::1]:3306: getsockopt: connection refused" file="mysqld_exporter.go" line=836

在客户端服务器中:

  • 我已经下载了mysqld exporter
  • 提取它
  • 创建.my.cnf文件

    [客户]
    用户= PROM

    密码= ABC123

  • 使用此命令获得该用户的权限

    的MySQL>授权复制客户端,处理以及#' @' localhost'由' abc123';

    标识

    的MySQL> GRANT SELECT ON performance_schema。* TO' prom' @' localhost';

  • 执行此命令

    ./ mysqld_exporter -config.my-cnf =" .my.cnf"

Prometheus状态页面显示为 UP 条件。 在Grafana中没有为MySQL加载数据

0 个答案:

没有答案