[Redis] Redis开源监控 redis live

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

我的Redis集群配置如下:三节点配置和名称(主 16C20G、子16C20G),每个节点4个实例22400~22403
192.168.111.140 HMASTER 22400 22401 22402 22403
192.168.111.141 HDATA01 22400 22401 22402 22403
192.168.111.142 HDATA02 22400 22401 22402 22403

我的Python版本 2.7.10

 

1.下载redis live安装包RedisLive-master.zip https://codeload.github.com/nkrode/RedisLive/zip/master
我的计划安装路径 /home/hadoop/BigData/RedisLive-master

$ unzip RedisLive-master.zip -d /home/hadoop/BigData/

 

2.安装依赖包,需要python的pip

$ pip install tornado
$ pip install redis
$ pip install python-dateutil

如果Python < 2.7也需要安装argparse

$ pip install argparse

 

3.编辑配置文件

$ cd /home/hadoop/BigData/RedisLive-master/src/
$ cp redis-live.conf.example redis-live.conf

参考如下:


{
"RedisServers":
[
{"server": "192.168.111.140",
"port" : 22400},
{"server": "192.168.111.140",
"port" : 22401},
{"server": "192.168.111.140",
"port" : 22402},
{"server": "192.168.111.140",
"port" : 22403},
{"server": "192.168.111.141",
"port" : 22400},
{"server": "192.168.111.141",
"port" : 22401},
{"server": "192.168.111.141",
"port" : 22402},
{"server": "192.168.111.141",
"port" : 22403},
{"server": "192.168.111.142",
"port" : 22400},
{"server": "192.168.111.142",
"port" : 22401},
{"server": "192.168.111.142",
"port" : 22402},
{"server": "192.168.111.142",
"port" : 22403}
],

"DataStoreType" : "sqllite",

"SqliteStatsStore" :
{
"path": "/home/hadoop/BigData/RedisLive-master/src/db/redislive.sqlite"
}
}

如果要将监控数据保存到redis中,可以设置”DataStoreType”: “redis”,参考如下:

{
"RedisServers":
[
{"server": "192.168.111.140",
"port" : 22400},
{"server": "192.168.111.140",
"port" : 22401},
{"server": "192.168.111.140",
"port" : 22402},
{"server": "192.168.111.140",
"port" : 22403},
{"server": "192.168.111.141",
"port" : 22400},
{"server": "192.168.111.141",
"port" : 22401},
{"server": "192.168.111.141",
"port" : 22402},
{"server": "192.168.111.141",
"port" : 22403},
{"server": "192.168.111.142",
"port" : 22400},
{"server": "192.168.111.142",
"port" : 22401},
{"server": "192.168.111.142",
"port" : 22402},
{"server": "192.168.111.142",
"port" : 22403}
],

"DataStoreType" : "redis",

"RedisStatsServer":
{
"server" : "192.168.111.140",
"port" : 192.168.111.140
},

"SqliteStatsStore" :
{
"path": "to your sql lite file"
}
}

 

4.启动redis live

#启动监控monitor更新数据,持续120秒
$ ./redis-monitor.py --duration=120
#启动监控WebUI
$ ./redis-live.py

 

这时,打开http://192.168.111.140:8888/index.html即可看到Redis的内容实时更新,演示如下


注意事项:file模式下,sql lite file是没有清理策略的,可以配合自己的调度程序进行日志文件的清理,如果文件太大,会影响性能
./configure –prefix=/usr/local/python27

 

分类上一篇:     分类下一篇:

Leave a Reply