下载 redis_exporter 插件
代理插件不一定非要安装在 Redis 端
wget https://github.com/oliver006/redis_exporter/releases/download/v0.30.0/redis_exporter-v0.30.0.linux-amd64.tar.gz
解压
tar xf redis_exporter-v0.30.0.Linux-amd64.tar.gz
启动 redis_exporter 登陆 Redis
- ## 无密码
- nohup ./redis_exporter -Redis.addr 192.168.1.120:6379 &
- ## 有密码
- nohup ./redis_exporter -Redis.addr 192.168.1.120:6379 -Redis.password 123456
Redis 默认端口是 6379
查看 redis_exporte 是否开启
- netstat -lntp
- tcp6 0 0 :::9121 :::* LISTEN 32407/redis_exporte
修改 prometheus 配置文件
VIM prometheus.YAML
- job_name: 'redis' static_configs: - targets: - "localhost:9121" #redis_exporte 在哪台服务器启动的就填哪台服务器 ip
重启 prometheus
nohup ./prometheus --config.file=./prometheus.YAML &
grafana 配置
配置 prometheus 数据源
添加 prometheus 插件, 然后配置
下载 Redis 仪表盘模板 https://grafana.com/dashboards/763
https://grafana.com/dashboards/763/revisions
导入模板
参考文献:
来源: https://www.cnblogs.com/zeq912/p/10614019.html