zoukankan      html  css  js  c++  java
  • 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

     参考:

    https://github.com/oliver006/redis_exporter

    http://www.manongjc.com/detail/14-zeamygqnueqlxwe.html

  • 相关阅读:
    简明Python3教程 12.问题解决
    简明Python3教程 11.数据结构
    【SPOJ 694】Distinct Substrings
    【codeforces Manthan, Codefest 17 C】Helga Hufflepuff's Cup
    【CF Manthan, Codefest 17 B】Marvolo Gaunt's Ring
    【CF Manthan, Codefest 17 A】Tom Riddle's Diary
    【SPOJ 220】 PHRASES
    【POJ 3261】Milk Patterns
    【POJ 3294】Life Forms
    【POJ 1226】Substrings
  • 原文地址:https://www.cnblogs.com/zhangmingcheng/p/13174241.html
Copyright © 2011-2022 走看看