J'ai configuré Prometheus sur Centos, les détails de la version sont les suivants.
prometheus-2.5.0.linux-386
J'ai ajouté deux cibles au fichier de configuration prometheus.yml, tous les exportateurs de nœuds de serveurs sont en cours d'exécution. Config comme suit,
scrape_configs:
- job_name: "node"
scrape_interval: "15s"
target_groups:
- targets: ['192.168.x.x:9100','192.168.x.y:9100']
Mais dans le Prométhée, Tragets n’affichant qu’un seul noeud. Si je supprime un noeud, le noeud existant est affiché. Comment puis-je surveiller plusieurs nœuds. Mais dans Grafana Dashboard indique Multiple Series Error .
J'ai configuré avec cette configuration sur prometheus.yml
# 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:9100']
- targets: ['192.168.x.z:9100']
Vous pouvez gratter les multiples cibles de Prometheus. Essayez de cette façon:
global:
scrape_interval: 15s # Scrape targets every 15 seconds
scrape_timeout: 15s # Timeout after 15 seconds
# Attach the label monitor=dev-monitor to all scraped time series scraped by this server
labels:
monitor: 'dev-monitor'
scrape_configs:
- job_name: "job-name"
scrape_interval: 10s # Override the default global interval for this job
scrape_timeout: 10s # Override the default global timeout for this job
target_groups:
# First group of scrape targets
- targets: ['localhost:9100', 'localhost:9101']
labels:
group: 'first-group'
# Second group of scrape targets
- targets: ['localhost:9200', 'localhost:9201']
labels:
group: 'second-group'
J'espère que cela t'aides.