zoukankan      html  css  js  c++  java
  • Redis监控工具

    环境介绍:

    系统:ubuntu14.04
    redis版本:redis-2.8.24
    监控工具:Redis Live、redis-stat

    Redis 安装

    1. wget -c http://download.redis.io/releases/redis-2.8.24.tar.gz
    2. tar zxmf redis-2.8.24.tar.gz
    3. mkdir -pv /opt/redis/{etc,logs} /export/redis/data
    4. cd redis-2.8.24/ &&make && make PREFIX=/opt/redis/ install
    5. vim /opt/redis/etc/redis.conf

      daemonize yes
      pidfile /var/run/redis.pid
      port 6379
      timeout 0
      tcp-backlog 10240
      tcp-keepalive 0
      loglevel warning
      logfile /opt/redis/logs/redis.log
      databases 16
      save 900 1
      save 300 10
      save 60 10000
      stop-writes-on-bgsave-error yes
      rdbcompression yes
      dbfilename dump.rdb
      dir /export/redis/data
      maxclients 10000
      maxmemory-policy volatile-lru
      maxmemory-samples 3
      appendonly yes
      appendfilename appendonly.aof
      appendfsync everysec
      no-appendfsync-on-rewrite no
      auto-aof-rewrite-percentage 10000
      auto-aof-rewrite-min-size 20000mb
      lua-time-limit 5000
      slowlog-log-slower-than 10000
      slowlog-max-len 128
      hash-max-ziplist-entries 512
      hash-max-ziplist-value 64
      list-max-ziplist-entries 512
      list-max-ziplist-value 64
      set-max-intset-entries 512
      zset-max-ziplist-entries 128
      zset-max-ziplist-value 64
      activerehashing yes
      client-output-buffer-limit normal 0 0 0
      client-output-buffer-limit slave 256mb 64mb 60
      client-output-buffer-limit pubsub 32mb 8mb 60

    6. /opt/redis/bin/redis-server /opt/redis/etc/redis.conf

    RedisLive

    python编写,分析查询语句并且有web界面的监控工具

    注:长时间运行对Redis性能有所影响

    安装RedisLive

    1. pip install tornado
    2. pip install redis
    3. pip install python-dateutil

    git clone live项目
    git clone https://github.com/kumarnitin/RedisLive.git

    conf配置
    cd src
    vim redis-live.conf

    {  
            "RedisServers":  
            [   
                    {  
                      "server" : "你的Redis IP地址",  
                      "port"  : 6379  
                    }
                    ........
                    可以多个
            ],  
    
    
            "DataStoreType" : "redis",  
    
            "RedisStatsServer":  
            {  
                    "server" : "你的Redis 监控IP地址",  
                    "port" : 6379  
            },
    
            "SqliteStatsStore" :
            {
                    "path":  "to your sql lite file"
            }
    }
    

    启动监控脚本,监控120秒,duration参数是以秒为单位
    ./redis-monitor.py —duration=120

    启动webserver。
    RedisLive使用tornado作为web服务器,所以不需要单独安装服务器
    Tornado web server 是使用Python编写出來的一个极轻量级、高可伸缩性和非阻塞IO的Web服务器软件
    ./redis-live.py

    http://ip:8888/index.html

    Redisstat

    一个用ruby写成的监控redis的程序,基于info命令获取信息,而不是通过monitor获取信息,性能应该比monitor要好。

    官网:https://github.com/junegunn/redis-stat

    ruby环境安装
    apt-get install ruby
    apt-get install rubygems

    redis-stat安装:
    gem install redis-stat
    如果报错请升级一下ruby

    使用
    命令行模式
    redis-stat localhost:6379 1 10
    web界面模式
    redis-stat —verbose —server=8080 5

  • 相关阅读:
    docker2核 elasticsearch卡死
    spring cloud config
    App网关Zuul
    spring Ribon
    spring Feign声明式服务消费(Ribbon Hystrix )
    spring Hystrix
    spring cloud 整体介绍
    springbean 生命周期
    xml六种解析方式
    jdk8中的forEach使用return执行下一次遍历
  • 原文地址:https://www.cnblogs.com/iteemo/p/5550654.html
Copyright © 2011-2022 走看看