redis 监控工具安装配置
http://blog.sina.com.cn/s/blog_53fab15a01018w8g.html
http://ylw6006.blog.iyunv.com/470441/1006313
centos6.3上redmon和redis-live两款开源软件的使用情况,前者基于ruby,后者则基于python
=================================== 自带的
redis-server:Redis服务器的daemon启动程序
redis-cli:Redis命令行操作工具。当然,你也可以用telnet根据其纯文本协议来操作
redis-benchmark:Redis性能测试工具,测试Redis在你的系统及你的配置下的读写性能
redis-stat:Redis状态检测工具,可以检测Redis当前状态参数及延迟状况
100个并发连接,100000个请求,检测host为localhost 端口为6379的redis服务器性能
/usr/local/redis/src/redis-benchmark -h localhost -p 6378 -c 100 -n 100000
====== LRANGE (first 300 elements) ======
100000 requests completed in 10.63 seconds
100 parallel clients
3 bytes payload
keep alive: 1
0.00% <= 1 milliseconds
0.01% <= 2 milliseconds
0.02% <= 3 milliseconds
0.05% <= 4 milliseconds
7.12% <= 5 milliseconds
96.77% <= 6 milliseconds
99.86% <= 7 milliseconds
99.89% <= 8 milliseconds
99.92% <= 9 milliseconds
99.94% <= 10 milliseconds
99.95% <= 12 milliseconds
99.96% <= 17 milliseconds
99.96% <= 22 milliseconds
99.96% <= 24 milliseconds
99.99% <= 25 milliseconds
100.00% <= 25 milliseconds
9408.22 requests per second
监控host为localhost,端口为6380,redis的连接及读写操作
/usr/local/redis/src/redis-cli -h localhost -p 6378 monitor
提供host为localhost,端口为6380,redis服务的统计信息
/usr/local/redis/src/redis-cli -h localhost -p 6378 info
实时打印出host为localhost,端口为6380,redis实例的总体信息
/usr/local/redis/src/redis-stat port 6378 overview
====================================redmon
whereis ruby
清除掉旧的ruby版本
#cd /root/
#bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
#echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
#/usr/local/rvm/bin/rvm list known
#/usr/local/rvm/bin/rvm install 1.9.2
#/usr/local/rvm/bin/rvm alias create default ruby-1.9.2-p320
#/usr/local/rvm/bin/rvm list
rvm rubies
=* ruby-1.9.2-p320 [ x86_64 ]
# => - current
# =* - current && default
# * - default
#ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
#ln -s /usr/local/rvm/bin/ruby /usr/bin/ruby
#ln -s /usr/local/rvm/bin/gem /usr/bin/gem
#ln -s /usr/local/ruby/bin/gem /usr/local/bin/gem
#ln -s /usr/local/rvm/bin/bundle /usr/local/bin/bundle
#gem install bundler
#git clone https://github.com/steelThread/redmon.git
#vim redmon/bin/redmon
#vim redmon/lib/redmon/config.rb
#grep -A 4 'option :redis_url' redmon/bin/redmon
option :redis_url,
:short => '-r URL',
:long => '--redis URL',
:default => 'redis://192.168.1.225:6378',
:description => "The Redis url for monitor (default: redis://192.168.1.78:6377)"
#grep -A 9 'class Config' redmon/lib/redmon/config.rb
class Config
DEFAULTS = {
:namespace => 'redmon',
:redis_url => 'redis://192.168.1.225:6378',
:app => true,
:worker => true,
:web_interface => ['0.0.0.0', 4567 ],
:poll_interval => 10,
:secure => false
}
#bundler install (或者是先cd redmon/ 然后bundler install )
#cd redmon/
#bundle exec /root/redmon/bin/redmon
http://192.168.1.75:4567/
====================redis-live :配置监控多台redis非常方便
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/python-pip-0.8-1.el6.noarch.rpm
rpm -ivh python-pip-0.8-1.el6.noarch.rpm
pip-python install tornado
pip-python install redis
pip-python install python-dateutil
pip-python install argparse
git clone https://github.com/kumarnitin/RedisLive.git
cd RedisLive/src
vim redis-live.conf
{
"RedisServers":
[
{
"server": "192.168.1.161",
"port" : 6378
},
{
"server" : "192.168.1.78",
"port" : 6380
},
],
"DataStoreType" : "sqlite",
"RedisStatsServer":
{
"server" : "127.0.0.1",
"port" : 6381
}
}
./redis-monitor.py --duration 120 &
./redis-live.py &
netstat -ntpl |grep python
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 7256/python
http://192.168.1.79:8888/index.html
运维网声明
1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网 享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com