0
点赞
收藏
分享

微信扫一扫

Redis服务的集中监控

倪雅各 2023-06-11 阅读 54


一:redmon的安装和使用
1:安装rvm,rvm是ruby version manager的缩写,ruby语言是鬼子弄出来的,虽然不是程序员,我也一直不待见,真心觉得难用!


#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  

 

2:查看可用的ruby版本


1. # /usr/local/rvm/bin/rvm list known

 

3:通过rvm安装ruby


1. # /usr/local/rvm/bin/rvm install 1.9.2   
2. # /usr/local/rvm/bin/rvm alias create default ruby-1.9.2-p320  
3. # /usr/local/rvm/bin/rvm list  
4. rubies
5.  
6. =* ruby-1.9.2-p320 [ x86_64 ]  
7.  
8. >
9. # =* - current && default  
10. #  * - default  
11.  
12. # ruby -v  
13. ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]

 

4:通过gem安装bundler

 


1. # gem install bundler

 

5:通过git获取redmon源代码并安装

 

  1. # git clone

https://github.com/steelThread/redmon.git



 

  1. Initialized empty Git repository in /root/redmon/.git/ 

 

  1. remote: Counting objects: 975, done. 

 

  1. remote: Compressing objects: 100% (506/506), done. 

 

  1. remote: Total 975 (delta 483), reused 928 (delta 436) 

 

  1. Receiving objects: 100% (975/975), 2.57 MiB | 714 KiB/s, done. 

 

  1. Resolving deltas: 100% (483/483), done. 
  1. # grep -A 4 'option :redis_url' redmon/bin/redmon

 

  1.   option :redis_url,

 

  1.     :short       => '-r URL',

 

  1.     :long        => '--redis URL',

 

  1.     :default     => 'redis://192.168.1.78:6377',

 

  1.     :description => "The Redis url for monitor (default: redis://192.168.1.78:6377)"
  1. # grep -A 9 'class Config' redmon/lib/redmon/config.rb

 

  1.   class Config

 

  1.     DEFAULTS = {

 

  1.       :namespace     => 'redmon',

 

  1.       :redis_url     => 'redis://192.168.1.78:6377',

 

  1.       :app           => true,

 

  1.       :worker        => true,

 

  1.       :web_interface => ['0.0.0.0', 4567],

 

  1.       :poll_interval => 10,

 

  1.       :secure        => false

 

  1.     }
  1. # cd redmon/ 

 

  1. # bundle exec /root/redmon/bin/redmon 

 

  1. >> Maximum connections set to 1024 

 

  1. >> Listening on 0.0.0.0:4567, CTRL+C to stop 

 

  1. [12-09-25 11:03:20] listening on http#0.0.0.0:4567

 

6:web接口情况,使用上存在无法添加对多个redis实例的监控 

 

Redis服务的集中监控_redis

 

redmon监控安装参考下列文章,在此感谢作者分享!
http://wangliang.me/?p=84https://github.com/steelThread/redmon

 

二:redis-live的安装和使用,同redmon相比,添加多个redis实例监控显得非常容易!而且实时性强,大赞!


1. # wget http://dl.fedoraproject.org/pub/epel/6/x86_64/python-pip-0.8-1.el6.noarch.rpm  
2. # rpm -ivh python-pip-0.8-1.el6.noarch.rpm  
3. # pip-python install tornado  
4. # pip-python install redis  
5. # pip-python install python-dateutil  
6. # pip-python install argparse  
7.  
8. # git clone https://github.com/kumarnitin/RedisLive.git  
9. Initialized empty Git repository in /root/RedisLive/.git/  
10. remote: Counting objects: 715, done.  
11. remote: Compressing objects: 100% (377/377), done.  
12. remote: Total 715 (delta 338), reused 699 (delta 323)  
13. Receiving objects: 100% (715/715), 2.59 MiB | 353 KiB/s, done.  
14. Resolving deltas: 100% (338/338), done.  
15.  
16. # cd RedisLive/src  
17. # cat redis-live.conf   
18. {  
19.         "RedisServers":  
20.         [   
21.                 {  
22.                   "server" : "192.168.1.78",  
23.                   "port"  : 6377  
24.                 },  
25.  
26.                 {  
27.                   "server" : "192.168.1.78",  
28.                   "port"  : 6380  
29.                 },  
30.                   
31.                {  
32.                   "server" : "192.168.1.78",  
33.                   "port"  : 6381  
34.                 }  
35.         ],  
36.           
37.  
38.         "DataStoreType" : "sqlite",  
39.  
40.         "RedisStatsServer":  
41.         {  
42.                 "server" : "127.0.0.1",  
43.                 "port" : 6381  
44.         }  
45. }  
46.  
47. # ./redis-monitor.py --duration  120  &  
48. # ./redis-live.py  &  
49. # netstat -ntpl |grep python  
50. tcp        0      0 0.0.0.0:8888                0.0.0.0:*                   LISTEN      6652/python           
51. tcp        0      0 :::8888                     :::*                        LISTEN      6652/python

 

web接口情况:

 

Redis服务的集中监控_redis_02

 

 

 

参考官方文档:http://www.nkrode.com/article/real-time-dashboard-for-redis

 

 

举报

相关推荐

0 条评论