【发布时间】:2022-01-22 23:16:39
【问题描述】:
我对这些组件不是很熟悉,但我正在尝试。 我在本地网络的 Ubuntu 服务器上安装了 Grafana 和 Prometheus。 Prometheus 正在使用 Node Exporter 收集自己的 Linux 指标,我可以使用 Prometheus 数据源在 Grafana 上显示指标。所以,我假设在这方面,对于本地使用,Prometheus 和 Grafana 都已正确设置。
我还在本地网络上的 Raspberry Pi 上安装了 Prometheus。 我确实设法将与 Raspberry Pi 相关的指标远程写入 Grafana Cloud。 现在我正在尝试将相同的指标远程写入上述 Ubuntu 服务器上的 Grafana,但我没有成功。
在 Raspberry Pi 上的 prometheus.yml 中,我已经替换了这个(正在工作):
#remote_write:
#- url: https://prometheus-blocks-prod-us-central1.grafana.net/api/prom/push
#name: grafana_cloud_prometheus
#basic_auth:
#username: something
#password: something
用这个:
remote_write:
- targets: "http://10.0.0.164/prometheus/remote/write"
name: Prometheus
basic_auth:
username: admin
password: admin
用户名和密码是在 Grafana 中设置的。
当我在 Pi 上重新启动 Prometheus 服务时,它失败了:
进程:8698 ExecStart=/home/pi/prometheus/prometheus --config.file=/home/pi/prometheus/prometheus.yml --storage.tsdb.path=/home/pi/prometheus/data --log.level=debug (code=e Main PID: 8698 (code=已退出,状态=2)
我不确定我做错了什么,或者我是否在这里遗漏了什么。 我确实尝试仅使用服务器 IP、IP 和端口来操纵目标,但我没有成功。 我将不胜感激一些帮助来解决这个问题。谢谢
【问题讨论】:
-
检查日志以确保了解,但我敢打赌它是 remote_write 配置中的未知 (
targets) 键。请改用url。
标签: linux prometheus