V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wsgzao
V2EX  ›  程序员

Prometheus 监控 Redis

  •  
  •   wsgzao ·
    wsgzao · Mar 26, 2019 · 1940 views
    This topic created in 2593 days ago, the information mentioned may be changed or developed.

    前言

    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

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   954 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 18:40 · PVG 02:40 · LAX 11:40 · JFK 14:40
    ♥ Do have faith in what you're doing.