prometheus监控redis
1、下载redis_exporter
https://github.com/oliver006/redis_exporter/releases
需要说明的是: redis_exporter 对于redis集群的监控表现不是太好, 建议为每个redis 实例启动一个redis_exporter, 如果一个服务器节点启动了多个redis进程, 就需要启动多个redis_exporter,如果采用一个redis_exporter 采集多个 redis node 会导致其中一个 redis node 连不上。
2、启动redis_exporter
./redis_exporter -redis.addr 192.168.11.111:6379 -web-listen-address 10.20.31.204:9121 & ./redis_exporter -redis.addr 192.168.11.111:7001 -web-listen-address 10.20.31.204:9122 & ./redis_exporter -redis.addr 192.168.11.111:7002 -web-listen-address 10.20.31.204:9123 & ./redis_exporter -redis.addr 192.168.11.111:7003 -web-listen-address 10.20.31.204:9124 & ./redis_exporter -redis.addr 192.168.11.111:7004 -web-listen-address 10.20.31.204:9125 & ./redis_exporter -redis.addr 192.168.11.111:7005 -web-listen-address 10.20.31.204:9126 &
启动参数说明:
- -redis.addr:指明 Redis 节点的地址,默认为 redis://localhost:6379(如果有多个redis实例, redis_exporter作者建议启动多个redis_exporter进程来进行监控数据获取)
- -redis.password:验证 Redis 时使用的密码;
- -redis.file:包含一个或多个redis 节点的文件路径,每行一个节点,此选项与 -redis.addr 互斥。
- -web.listen-address:监听的地址和端口,默认为 0.0.0.0:9121
3、prometheus 配置
- job_name: ‘redis‘ static_configs: - targets: [‘10.20.31.204:9121‘] labels: instance: redis204-6379 - targets: [‘10.20.31.204:9122‘] labels: instance: redis204-7001 - targets: [‘10.20.31.204:9123‘] labels: instance: redis204-7002 - targets: [‘10.20.31.204:9124‘] labels: instance: redis204-7003 - targets: [‘10.20.31.204:9125‘] labels: instance: redis204-7004 - targets: [‘10.20.31.204:9126‘] labels: instance: redis204-7005
4、grafana 配置 dashbord
redis_exporter 在 Grafana 上为我们提供好了 Dashboard 模板:https://grafana.com/dashboards/763
参考:
相关推荐
王道革 2020-11-25
wangdonghello 2020-11-03
Langeldep 2020-11-16
chenhualong0 2020-11-16
聚合室 2020-11-16
koushr 2020-11-12
MRFENGG 2020-11-11
guoyanga 2020-11-10
fackyou00 2020-11-10
Orangesss 2020-11-03
dongCSDN 2020-10-31
rainandtear 2020-10-30
Quietboy 2020-10-30
liuyulong 2020-10-29
fansili 2020-10-29
温攀峰 2020-10-23
jackbon 2020-10-19
kaixinfelix 2020-10-04