微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

获取"http://localhost:9100/metrics": dial tcp [::1]:9100: connectex: 由于目标机器主动拒绝,无法建立连接

如何解决获取"http://localhost:9100/metrics": dial tcp [::1]:9100: connectex: 由于目标机器主动拒绝,无法建立连接

我已经在本地成功安装了 Prometheus。问题是我的 node 状态因错误 Get "http://localhost:9100/metrics": dial tcp [::1]:9100: connectex: No connection Could be made because the target machine actively refused it.关闭,但其他人没问题。

这是我在 prometheus.yml 中的配置

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['localhost:9090']
    
  - job_name: 'web'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
    scheme: https
    static_configs:
    - targets: ['localhost:44358'] 
    
  - job_name: node
    static_configs:
    - targets: ['localhost:9100']

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。