我们可以在一台计算机上使用普罗米修斯,而在不同节点上使用node_exporter,并将所有度量标准收集到存在普罗米修斯的单台计算机上吗?
答案 0 :(得分:2)
是的,可以。这个想法是,您拥有一台(或几台)Prometheus服务器,可以根据需要从许多其他服务器上收集度量标准。
您不必在要监视的每台服务器上运行Prometheus本身,只需在您要从中收集指标的导出器(例如,node_exporter)上运行。
答案 1 :(得分:0)
按如下所示更改prometheus.yml(prometheus-2.5.0)以添加多个主机,
# my global config
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: 'node'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['192.168.x.x:9100']
- targets: ['192.168.x.y:8080']
答案 2 :(得分:0)
这是为普罗米修斯设计的。
在一台计算机上安装prometheus服务器,并在各处安装node_exporter。