alertmanager
go
wget https://github.com/prometheus/alertmanager/releases/download/v0.27.0/alertmanager-0.27.0.linux-amd64.tar.gz
go
tar -zxvf alertmanager-0.27.0.linux-amd64.tar.gz
mv alertmanager-0.27.0.linux-amd64 alertmanager
cd alertmanager/
mkdir alertmanager_data
go
vim /lib/systemd/system/alertmanager.service
go
[Unit]
Description=alertmanager service
[Service]
User=root
ExecStart=/root/alertmanager/alertmanager \
--config.file=/root/alertmanager/alertmanager.yml \
--storage.path=/root/alertmanager/alertmanager_data
TimeoutStopSec=10
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
go
systemctl daemon-reload
systemctl enable alertmanager.service
systemctl start alertmanager.service
systemctl status alertmanager.service
go
# netstat -ntlp | grep alertmanager
tcp6 0 0 :::9093 :::* LISTEN 594433/alertmanager
tcp6 0 0 :::9094 :::* LISTEN 594433/alertmanager
go
9093 端口: 这是 Alertmanager 的默认端口,用于其 Web 用户界面和 API。
9094 端口: Alertmanager 使用 9094 端口进行集群通信