博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Redis监控工具
阅读量:4699 次
发布时间:2019-06-09

本文共 2426 字,大约阅读时间需要 8 分钟。

环境介绍:

系统:ubuntu14.04

redis版本:redis-2.8.24
监控工具:Redis Live、redis-stat

Redis 安装

  1. wget -c
  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

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

Redisstat

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

官网:

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

转载于:https://www.cnblogs.com/iteemo/p/5550654.html

你可能感兴趣的文章
java输入与输出
查看>>
Linux内核
查看>>
URI,URL,URN
查看>>
centos7下使用yum安装mysql
查看>>
Android View的绘制机制流程深入详解(二)
查看>>
lr 中cookie的解释与用法
查看>>
25匹马的角逐
查看>>
Javascript 中的变量作用域问题
查看>>
MySQL不支持top n的语法
查看>>
62. Unique Paths
查看>>
Error building results for action sayHello in namespace /inteceptor -
查看>>
Hive中分组取前N个值
查看>>
小程序弹窗实例
查看>>
CozyRSS2开发记录0-win10开坑
查看>>
iOS Safari 中click点击事件失效的解决办法
查看>>
公交线路查询接口
查看>>
关于OC中的block自己的一些理解(一)
查看>>
HBase使用场景和成功案例 (转)
查看>>
Flutter 即学即用系列博客——09 MethodChannel 实现原生与 Flutter 通信(二)
查看>>
pom.xml详解
查看>>