我是靠谱客的博主 壮观大船,最近开发中收集的这篇文章主要介绍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 Prometheus 配置提示connect: connection refused所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复