redis-stat是一个用ruby写成的监控redis的程序,基于info命令获取信息,而不是通过monitor获取信息
一、安装ruby
yum install -y ruby ruby-devel rubygems
apt-get install rubygems ruby1.9.1
由于国内网络原因,导致 rubygems.org 存放在 Amazon S3 上面的资源文件间歇性连接失败。所以你会与遇到 gem install rack 或 bundle install 的时候半天没有响应,所以需要修改rubygems为淘宝镜像。
二、替换rubygems
gem sources --add https://ruby.taobao.org/ --remove http://rubygems.org/
gem sources -l
三、安装redis-stat
git clone https://github.com/junegunn/redis-stat.git
gem install redis-stat
会提示
Building native extensions. This could take a while...
Building native extensions. This could take a while...
Building native extensions. This could take a while...
ERROR: Error installing redis-stat:
redis-stat requires daemons (~> 1.1.9, runtime)
四、卸载daemons
gem uninstall daemons
gem install daemons
gem install redis-stat
装redis-stat同时会安装daemons-1.1.9,如果系统已安装daemons其他版本,需再次卸载
ERROR: Error installing redis-stat:
redis-stat requires daemons (~> 1.1.9, runtime)
gem uninstall daemons
Select gem to uninstall:
1. daemons-1.1.9
2. daemons-1.2.3
3. All versions
> 2
Successfully uninstalled daemons-1.2.3
五、安装SystemTimer
gem install SystemTimer
然后就可以启动redis-stat了
redis-stat --verbose --server=8090 5 110.47.90.168:6379 110.160.4.71:6379
redis-stat 110.160.4.71:6379 110.47.90.168:6379 1 10
参考地址
https://github.com/junegunn/redis-stat