我是靠谱客的博主 壮观大船,这篇文章主要介绍docker Prometheus 配置提示connect: connection refused,现在分享给大家,希望可以做个参考。

docker搭建Prometheus,配置文件prometheus.yml如下:

global:
  scrape_interval:     60s
  evaluation_interval: 60s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
        labels:
          instance: Prometheus

  - job_name: linux
    static_configs:
      - targets: ['localhost:9100']
        labels:
          instance: linux
  - job_name: mysql
    static_configs:
      - targets: ['localhost:9104']
        labels:
          instance: mysql

localhost:9100、localhost:9104  报错:connect refused!


global:
  scrape_interval:     60s
  evaluation_interval: 60s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
        labels:
          instance: Prometheus

  - job_name: linux
    static_configs:
      - targets: ['10.17.0.1:9100'] //内网ip
        labels:
          instance: linux
  - job_name: mysql
    static_configs:
      - targets: ['10.17.0.1:9104'] //内网ip
        labels:
          instance: mysql

localhost改成docker内网ip

重启 prometheus

docker restart  prometheus

 查看targets状态为UP,即为正常

 

最后

以上就是壮观大船最近收集整理的关于docker Prometheus 配置提示connect: connection refused的全部内容,更多相关docker内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(113)

评论列表共有 0 条评论

立即
投稿
返回
顶部