我试着用普罗米修斯在库伯奈特做监控。我们在外部postgres数据库中存储了一些度量,所以首先我想安装postgres出口商。我使用这个舵图来安装它:https://github.com/helm/charts/tree/master/stable/prometheus-postgres-exporter,并用我的数据库信息填充values.yaml。安装后,它向我提供了以下说明:
NOTES:
1. Get the application URL by running these commands:
export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus-postgres-exporter,release=veering-seastar" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80但是当我试图转发港口时,我的连接被拒绝了:
Handling connection for 8080
E0801 19:51:02.781508 22099 portforward.go:331] an error occurred forwarding 8080 -> 80: error forwarding port 80 to pod 37a502b22a15fefcbddd3907669a448c99e4927515fa6cdd6fd87ef774993b6b, uid : exit status 1: 2018/08/02 02:51:02 socat[32604] E connect(5, AF=2 127.0.0.1:80, 16): Connection refused然而,当我做kubectl描述时,吊舱是正常工作的,那里只有三个日志:
time="2018-08-02T01:08:45Z" level=info msg="Established new database connection." source="postgres_exporter.go:995"
time="2018-08-02T01:08:45Z" level=info msg="Semantic Version Changed: 0.0.0 -> 9.5.12" source="postgres_exporter.go:925"
time="2018-08-02T01:08:46Z" level=info msg="Starting Server: :9187" source="postgres_exporter.go:1137"这里是否有我缺少的东西可以让它正常工作,并且能够通过端口转发看到度量标准?
发布于 2018-08-02 04:16:36
time="2018-08-02T01:08:46Z“level=info msg=”启动服务器:9187“source="postgres_exporter.go:1137”
看起来图表注释文本只是有一个复制粘贴错误,因为端口号不是:80,而是:9187,这很好,因为它与注册表中的postgresql导出端口匹配。
因此,应该是:
kubectl port-forward 9187:9187 &
sleep 2
curl localhost:9187/metricshttps://stackoverflow.com/questions/51644890
复制相似问题