gpt4 book ai didi

linux - 普罗米修斯远程写入

转载 作者:行者123 更新时间:2023-12-02 16:01:57 25 4
gpt4 key购买 nike

我对这些组件不是很熟悉,但我正在尝试。我在本地网络的 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 服务时,它失败了:

Process: 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=exited, status=2)

我不确定我做错了什么,或者我是否遗漏了什么地方。我确实尝试仅使用服务器 IP、IP 和端口来操纵目标,但我没有成功。我将不胜感激一些帮助来解决这个问题。谢谢

最佳答案

您无法远程写入 Grafana(可视化软件),它通过查询 Prometheus 本身来访问数据。远程写入旨在用于写入其他 Prometheus 实例、长期存储后端(如 Thanos 和 Cortex)或 SaaS 平台(如 Grafana Cloud)。

您可能想要做的是将该 Prometheus 实例添加为 Grafana 中的数据源。

关于linux - 普罗米修斯远程写入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70437057/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com