【发布时间】:2019-08-19 09:07:35
【问题描述】:
我目前正在尝试设置必须使用 IPv6 的内部 Prometheus 监控系统。我的静态配置不起作用:
- targets: ['[fe80::3086:7bff:fed8:f402]:9100']
这会失败并出现错误
Get http://[fe80::3086:7bff:fed8:f402]:9100/metrics: dial tcp [fe80::3086:7bff:fed8:f402]:9100: connect: invalid argument
我尝试使用 CURL 来查看是否可以连接到运行 node-exporter 的远程服务器。
这不起作用:curl -g -6 'http://[fe80::3086:7bff:fed8:f402]:9100/metrics'
但这确实有效:curl -g -6 'http://[fe80::3086:7bff:fed8:f402%ens17]:9100/metrics'
这表明我实际上能够连接到服务器,但必须将连接 IPv6 网络顶部的网络接口添加到 URL 中。老实说,我不知道为什么。
但是现在,同样的URL对prometheus不起作用,还是报错:
- targets: ['[fe80::3086:7bff:fed8:f402%ens17]:9100']
Get http://[fe80::3086:7bff:fed8:f402%25ens17]:9100/metrics: dial tcp [fe80::3086:7bff:fed8:f402%ens17]:9100: connect: invalid argument
【问题讨论】:
标签: ipv6 prometheus prometheus-node-exporter