github地址包含docker-compose安装方法
组件介绍:
Prometheus server 包含数据采集scrapes job, stores time series data;
push gateway : Prometheus server的一个代理节点, 当一些节点没有提供HTTP endpoint时,可将数据push到代理节点,Prometheus会去代理节点获取数据;
exporters: 数据采集插件, 暴露一个http服务的接口给Prometheus server定时抓取;
alertmanager: 报警插件;
监控系统搭建
1 安装prometheus
主机:192.168.200.118
(1),下载二进制包:
wget https://github.com/prometheus/prometheus/releases/download/v2.16.0/prometheus-2.16.0.linux-amd64.tar.gz
(2),解压包:tar -zxvf prometheus-2.16.0.linux-amd64.tar.gz
(3),移动到规范目录:mv prometheus-2.16.10.linux-amd64 /opt/prometheus
(4),进入目录:cd /opt/prometheus
(5),新建启动脚本
[root@test-zhapigw prometheus]# cat start.sh
nohup /opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.retention=90d --web.enable-lifecycle &
[root@test-zhapigw prometheus]# chmod 777 start.sh
(6),新建重载配置脚本
[root@test-zhapigw prometheus]#cat reload.sh
#!/bin/bash
curl -XPOST http://127.0.0.1:9090/-/reload
[root@test-zhapigw prometheus]# chmod 777 reload.sh
(7),启动prometheus
bash /opt/prometheus/start.sh
(8),测试访问
http://192.168.200.118:9090/graph
(9),查看metrics暴漏出来的指标。
地址:http://192.168.200.118:9090/metrics