这是我的第一个问题,如果我做错了什么,很抱歉。(英语不是我的主要语言)
我正在实现我的第一个prometheus联邦系统,我不知道如何连接位于不同网络和防火墙中的两台服务器。
我不知道是否必须配置两个防火墙,或者是否必须配置我的prometheus配置文件。
这是我的普罗米修斯的全局配置。im使用node-exporter来获取指标。
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"
# 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"
static_configs:
- targets: ["192.168.0.223:9090"]
- job_name: "node"
scrape_interval: 15s
scrape_timeout: 10s
static_configs:
- targets:
- 192.168.0.223:9100
- 18.230.81.178:9100
- 189.90.67.24:9100发布于 2021-10-06 17:10:03
这里的问题与Prometheus本身无关,您必须保证Prometheus能够抓取端口9100中的地址,否则它将无法工作。
我建议您测试您的Prometheus实例是否可以在其他端口上访问这些地址,以及是否存在特定于端口9100的防火墙规则。要使其正常工作,您必须至少能够与这些网络中的端口80通信,以便可以设置联合体系结构。这样,您将在每个网络中有一个Prometheus实例抓取您的节点,并在端口80(或其他可访问的)中有一个集中的实例抓取您的联邦Prometheus。
https://stackoverflow.com/questions/69456191
复制相似问题