Alertmanager 集群
Alertmanager 集群搭建
环境准备:2台主机 (centos 7)
192.168.31.151
192.168.31.144
1、安装部署 192.168.31.151
cd /usr/local tar -xvf alertmanager-0.16.2.linux-amd64.tar.gz ln -s alertmanager-0.16.2.linux-amd64 /usr/local/alertmanager cd /usr/local/alertmanager mkdir bin conf data mv alertmanager ./bin/ mv amtool ./bin/ mv alertmanager.yml ./conf/
2、启动命令
nohup /usr/local/alertmanager/bin/alertmanager --config.file=/usr/local/alertmanager/conf/alertmanager.yml --storage.path=/usr/local/alertmanager/data --cluster.listen-address=0.0.0.0:9094 --cluster.peer 192.168.31.144:9094 > alertmanager.out 2>&1 &
3、安装部署192.168.31.144
cd /usr/local tar -xvf alertmanager-0.16.2.linux-amd64.tar.gz ln -s alertmanager-0.16.2.linux-amd64 /usr/local/alertmanager cd /usr/local/alertmanager mkdir bin conf data mv alertmanager ./bin/ mv amtool ./bin/ mv alertmanager.yml ./conf/
4、启动命令
nohup /usr/local/alertmanager/bin/alertmanager --config.file=/usr/local/alertmanager/conf/alertmanager.yml --storage.path=/usr/local/alertmanager/data --cluster.listen-address=0.0.0.0:9094 --cluster.peer 192.168.31.151:9094 > alertmanager.out 2>&1 &
5、修改prometheus配置
alerting: alertmanagers: - static_configs: - targets: - 192.168.31.151:9093 - 192.168.31.144:9093
6、reload
curl -X POST http://127.0.0.1:9090/-/reload