# 下载redis_exporter
wget https://github.com/oliver006/redis_exporter/releases/download/v1.3.3/redis_exporter-v1.3.3.linux-amd64.tar.gz
tar zxf redis_exporter-v1.3.3.linux-amd64.tar.gz
cd redis_exporter-v1.3.3.linux-amd64
# 启动,有密码则要加 -redis.password 12121
nohup ./redis_exporter -redis.addr 192.168.1.120:6379 &
# 检查是否启动成功
netstat -lntp
tcp6 0 0 :::9121 :::* LISTEN 32407/redis_exporte
# prometheus.yml中增加配置
vim prometheus.yml
- job_name: 'redis'
scrape_interval: 10s
static_configs:
- targets:
- "localhost:9121" # redis_exporte 的 ip端口
# 刷新prometheus.yml
ps -ef|grep prometheus
brain 13898 1 0 11月05 ? 00:43:28 ./prometheus --web.listen-address=:9000 --config.file=prometheus.yml
brain 21521 21304 0 15:11 pts/1 00:00:00 grep --color=auto prometheus
kill -HUP 13898
# grafana导入763模板
https://grafana.com/grafana/dashboards/763/revisions
Prometheus + Grafna监控Redis
最新推荐文章于 2024-04-29 07:15:00 发布