SpringBoot集成Prometheus实现Alert Manager告警上报(一)

摘要

SpringBoot集成Prometheus实现Alert Manager告警上报

一、准备工作

一个可用的vm 系统:CentOS7

 两个springboot项目:创建Srpingboot项目 (一个作为被监控的服务,一个作为接收告警上报服务)

下载Prometheus:Prometheus

下载AlertManager:AlertManager

Prometheus官网 如果需要其他版本或其他组件,请自行下载

二、安装启动Prometheus

1、解压:[root@localhost opt]# tar -zxfv prometheus-2.47.0.linux-amd64.tar.gz

2、启动

[root@localhost opt]# cd prometheus-2.47.0.linux-amd64/

在目录下启动

[root@localhost opt]# ./prometheus --config.file=prometheus.yml

或者用 

nohup ./prometheus --config.file=prometheus.yml > prometheus.out 2>&1 &

3、打开Prometheus UI界面:http://IP地址:9090 我当前VM的地址 http://192.168.160.151:9090/

启动Prometheus成功

三、安装AlertManager

1、解压:

[root@localhost opt]# tar -zxfv alertmanager-0.26.0.linux-amd64.tar.gz

2、启动

[root@localhost opt]# cd alertmanager-0.26.0.linux-amd64/

在目录下启动

[root@localhost opt]# ./alertmanager --config.file=alertmanager.yml 

 

或者用

 nohup ./alertmanager --config.file=alertmanager.yml > alert.out 2>&1 &

打开AlertManager UI界面:http://IP地址:9093 我当前VM的地址:http://192.168.160.151:9093/

四、注意事项:

1、Linux的防护墙问题:会导致两个组件的界面无法访问,需要开通端口。

        判断依据:关闭防火墙是否可以访问

systemctl stop firewalld.service

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值