prometheus監控redis


下載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.yml
 - job_name: 'redis'
    static_configs:
    - targets:
      - "localhost:9121"   #redis_exporte在哪台服務器啟動的就填哪台服務器ip

重啟prometheus

nohup ./prometheus --config.file=./prometheus.yml &

grafana配置

配置prometheus數據源
添加prometheus插件,然后配置

image.png
image.png
image.png

下載redis儀表盤模板

https://grafana.com/dashboards/763/revisions
image.png

導入模板

選區_004.png
image.png

參考文獻:

https://github.com/oliver006/redis_exporter?spm=a2c4e.11153940.blogcont251478.18.6156d4895PIlpc


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM