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内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复