一、安装
# RPM 安装
wget https://dl.grafana.com/oss/release/grafana-10.0.0-1.x86_64.rpm
yum localinstall grafana-10.0.0-1.x86_64.rpm
# APT 安装
wget https://packages.grafana.com/gpg.key
apt-key add gpg.key
echo "deb https://packages.grafana.com/oss/deb stable main" > /etc/apt/sources.list.d/grafana.list
apt-get update
apt-get install grafana
二、服务管理
# 启动
systemctl start grafana-server
# 停止
systemctl stop grafana-server
# 重启
systemctl restart grafana-server
# 开机自启
systemctl enable grafana-server
三、访问
地址: https://localhost:3000
默认用户: admin
默认密码: admin
四、常用查询
# CPU 使用率
100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
# 内存使用率
(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) / node_memory_MemTotal_bytes * 100
五、快捷命令
| 用途 |
命令 |
| 启动 |
systemctl start grafana-server |
| 重启 |
systemctl restart grafana-server |
| 访问 |
https://localhost:3000 |
| 默认密码 |
admin/admin |