[root@prome-devops01cn ~]# cd /data/soft/
[root@prome-devops01cn soft]# ls
alertmanager-0.15.3.linux-amd64.tar.gz
blackbox_exporter-0.13.0.linux-amd64.tar.gz
2.2.部署prometheu
2.2.1.解压prometheus
主配置⽂文件为prometheus.yml,启动⽂文件为prometheus
2.2.2.查看默认配置⽂文件
targets:
127.0.0.1:9093 #报警组件alertmanager地址(在下
一节说明alertmanager部署)
2.2.3.启动prometheus服务测试
level=info ts=2018-12-11T06:58:03.485957364Z caller=main.go:658 msg="Completed loading of configuration file" filename=prometheus.yml level=info ts=2018-12-11T06:58:03.48597572Z caller=main.go:531 msg="Server is ready to receive web requests."
出现上⾯面的提示,说明prometheus服务启动正常
[root@prome-devops01cn soft]# tar xvf prometheus- 2.5.0.linux-amd64.tar.gz -C /data/services/
[root@prome-devops01cn soft]# cd /data/services/prometheus- 2.5.0.linux-amd64/
[root@prome-devops01cn prometheus-2.5.0.linux-amd64]# ls LICENSE NOTICE console_libraries consoles prometheus prometheus.yml promtool
[root@prome-devops01cn prometheus-2.5.0.linux-amd64]# cat 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:
# Load rules once and periodically evaluate them
according to the global 'evaluation_interval'.
rule_files:
- "alert_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'
# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['localhost:9090']