V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wsgzao
V2EX  ›  程序员

Prometheus 监控 Redis

  •  
  •   wsgzao ·
    wsgzao · 2019-03-26 19:23:19 +08:00 · 1547 次点击
    这是一个创建于 1856 天前的主题,其中的信息可能已经有所发展或是发生改变。

    前言

    Prometheus Exporter for Redis Metrics. Supports Redis 2.x, 3.x, 4.x, and 5.x

    Prometheus 监控 Redis

    更新历史

    2019 年 03 月 23 日 - 初稿

    阅读原文 - https://wsgzao.github.io/post/prometheus-redis/

    扩展阅读

    redis_exporter - https://github.com/oliver006/redis_exporter


    Redis export 安装和使用

    # 下载 redis_exporter
    https://github.com/oliver006/redis_exporter/releases
    cd /tmp
    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
    nohup ./redis_exporter -redis.addr redis://<IP>:<PORT> &
    
    # iptables rule for Prometheus Redis 
    -A INPUT -s xxx -p tcp --dport 9121 -j ACCEPT
    
    # 测试 URL 获取 metrics
    curl http://<IP>:9121/metrics
    

    Grafana

    Memory Usage 中 redis_config_maxmemory 如果无法获取到数据请自行定义 value

    https://grafana.com/dashboards/763

    参考文献

    https://prometheus.io/docs/instrumenting/exporters/#databases

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5447 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 09:00 · PVG 17:00 · LAX 02:00 · JFK 05:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.