【问题标题】:Prometheus Monitoring Issue for MySQLMySQL 的 Prometheus 监控问题
【发布时间】:2016-09-19 07:44:22
【问题描述】:

Percona link 中所述,我正在尝试设置 MySQL 监控

我是第一次设置。

这是我的 Prometheus 配置文件:

    global:
  scrape_interval:     5s
  evaluation_interval: 5s
scrape_configs:
- job_name: linux
  static_configs:
  - targets:
    - '172.19.36.189:3306'
    labels:
      alias: db1

Prometheus version:

prometheus, version 1.1.2 (branch: master, revision: 36fbdcc)
build user: root@a74d279
build date: 20160908-13:12:43
go version: go1.6.3

当我检查 Prometheus 目标页面时:我收到以下错误:

Prometheus 日志中没有报告错误。

当我点击指标链接时,指标页面没有打开。并且目标的状态是DOWN。

我也已经正确启动了 mysqld 和节点导出器。

问题出在哪里?

【问题讨论】:

    标签: percona grafana prometheus


    【解决方案1】:

    您需要抓取 mysqld 导出器(通常是端口 9104),而不是 mysqld 本身。

    【讨论】:

    • 我该怎么做?如果您能帮助我解决这个问题,我将不胜感激。
    • 现在我得到这个错误:Get 172.19.36.189:9104/metrics: dial tcp 172.19.36.189:9104: getsockopt: connection denied
    【解决方案2】:

    当抓取目标无法到达时要检查三件事:

    1. 网络:

      是否可以从您在浏览器中打开 Prometheus GUI 的位置访问抓取目标 http://172.19.36.189:9104/metrics?检查curl -vvv http://172.19.36.189:9104/metricshttp://172.19.36.189:9104/metrics 的任何代理。

    2. 普罗米修斯日志:

      使用标志--log.level启动prometheus并打开调试:

      $ /bin/prometheus -h
      ...
      --log.level=info      [debug,
                            info,
                            warn,
                            error]
      

      然后,使用以下命令检查容器的日志:

      docker logs <name of prometheus container>
      kubectl logs <name of prometheus pod>
      
    3. 容器/pod/service中是否暴露了爬取目标的端口9104

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-30
      • 2016-05-29
      • 2020-08-09
      • 1970-01-01
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 2022-11-04
      相关资源
      最近更新 更多