安装Redis - Prometheus监控
参考:Prometheus+Grafana学习(十)监控Redis_码农-文若书生的博客-CSDN博客_prometheus+grafana监控redis
下载地址:Releases · oliver006/redis_exporter (github.com)
安装
下载:
wget https://github.com/oliver006/redis_exporter/releases/download/v1.44.0/redis_exporter-v1.44.0.linux-amd64.tar.gz
解压:
tar -zxvf redis_exporter-v1.44.0.linux-amd64.tar.gz
注册系统服务:
vim /etc/systemd/system/redis_node_exporter.service
[Service]
WorkingDirectory=/opt/sofeware/redis_exporter/
PrivateTmp=true
Restart=always
Type=simple
ExecStart=/opt/sofeware/redis_exporter/redis_exporter -redis.addr=localhost:6379 -redis.password=你的redis密码
ExecStop=/usr/bin/kill -9 $MAINPID
[Install]
WantedBy=multi-user.target设置启动项
systemctl daemon-reload
systemctl enable redis_node_exporter.service
systemctl start redis_node_exporter.service
systemctl status redis_node_exporter.service
测试
代码:curl localhost:9121/metrics
成功::注意放行防火墙端口!!
配置Prometheus
修改Prometheus配置文件:vim /opt/sofeware/prometheus/prometheus.yml
scrape_configs: |
配置Grafana
点击Import导入,导入成功如下:
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Bai's Blog!