您的位置:首页 > 数据库 > Redis

Redis集群监控工具之RedisLive

2016-03-29 22:33 916 查看
这里将介绍下redis集群监控UI工具之RedisLive的安装部署。

说白了,RedisLive就是一款免费开源的基于Python、tornado的的reids的监控工具,以WEB的形式展现出redis中的内存、key,实例数据等信息!RedisLive官网

安装Python

因为RedisLive是基于Python的,所以机器必须先安装Python,可输入Python来监测机器是否安装Python,如下则说明已经安装OK,否则需要安装(此过程可谷歌,这里不赘述)。

[root@spg sbin]# python
Python 2.7.5 (default, Jun 17 2014, 18:11:42)
[GCC 4.8.2 20140120 (Red Hat 4.8.2-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>


安装tornado等

RedisLive是WEB监控界面,所以需要WEB容器,这里需要使用的是tornado,可使用如下方式快速安装。

[root@spg sbin]# pip install tornado


此时可能报错,提示pip未安装,则需要安装pip。

具体可参考:https://pip.pypa.io/en/stable/installing/

pip安装成功后,继续安装tornado、redis、python-dateutil

[root@spg sbin]# pip install tornado
[root@spg sbin]# pip install redis
[root@spg sbin]# pip install python-dateutil


如果Python版本小于2.7,则还需要安装argparse

[root@spg sbin]# pip install argparse


安装RedisL

[root@spg sbin]# git clone https://github.com/kumarnitin/RedisLive.git[/code] 
或者直接在github上下载

配置RedisLive

进入src,复制redis-live.conf.example,改为redis-live.conf

{
"RedisServers":
[
{
"server": "localhost",
"port" : 6380
},
{
"server": "localhost",
"port" : 6381
},
{
"server": "localhost",
"port": 6382
}
],
"DataStoreType" : "redis",
"RedisStatsServer":
{
"server" : "localhost",
"port" : 6383
},
"SqliteStatsStore" :
{
"path":  "to your sql lite file"
}
}


配置说明:

在RedisServers中设置需要监控的redis-server;

DataStoreType决定使用那种类型的数据存储,

如果是redis,使用RedisStatsServer作为数据存储的目标;

如果是sqlite,使用SqliteStatsStore作为数据存储的目标。

启动RedisLive

RedisLive分为两部分,其中一部分为监控脚本,另一部分为web服务,所以需要分别启动。

[root@spg sbin]# ./redis-monitor.py --duration=120
[root@spg sbin]# ./redis-live.py


使用–duration来指定多长时间去取一次reids的数据

此时,访问http://127.0.0.1:8888/index.html即可访问RedisLive,界面如下



至此,RedisLive安装完毕。

参看:

http://www.nkrode.com/article/real-time-dashboard-for-redis
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: