一、安装prometheus
1.1下载
https://prometheus.io/download/
1.2 安装
tar -zxvf prometheus-2.52.0.linux-amd64.tar.gz
cp -R prometheus-2.47.2.linux-amd64 /usr/local/prometheus
vim /usr/lib/systemd/system/prometheus.service
prometheus.service配置文件内容
[Unit]
Description=Prometheus
Documentation=https://prometheus.io/
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/usr/local/prometheus
ExecStart=/usr/local/prometheus/prometheus
Restart=on-failure
[Install]
WantedBy=multi-user.target
1.3 开机启动
systemctl daemon-reload
systemctl enable prometheus.service
systemctl start prometheus.service
1.4 验证
http://192.168.1.106:9090/
二、安装 Grafana
2.1 下载
官网
https://grafana.com/grafana/download
下载地址:https://dl.grafana.com/enterprise/release/grafana-enterprise-11.0.0-1.x86_64.rpm
2.2 安装
yum install -y grafana-enterprise-11.0.0-1.x86_64.rpm
2.3 启动
# 开机启动
systemctl enable grafana-server
# 启动
systemctl start grafana-server
2.4 验证
- 地址:http://192.168.1.106:3000/
- 默认密码:admin/admin
- 登录后要求修改原始密码