redis-live监控redis集群

1、安装easy_install
   wget https://bootstrap.pypa.io/ez_setup.py -O - | python
2、安装pip
   easy_install pip
3、安装redis-live依赖
   pip install tornado
   pip install redis 
   pip install python-dateutil
   pip install argparse
4、从github下载redis-live源代码
   git clone https://github.com/nkrode/RedisLive.git
   cd ./RedisLive/src
   cp redis-live.conf.example redis-live.conf
   vim redis-live.conf

 
{
        "RedisServers":
        [
                {
                        "server": "127.0.0.1",
                        "port" : 7000,
                        "password" : "redis123"
                },
                {
                        "server": "127.0.0.1",
                        "port" : 7001,
                        "password" : "redis123"
                },
                {
                        "server": "127.0.0.1",
                        "port" : 7002,
                        "password" : "redis123"
                },
                {
                        "server": "127.0.0.1",
                        "port" : 7003
                },

                {
                        "server": "127.0.0.1",
                        "port" : 7004
                },
                {
                        "server": "127.0.0.1",
                        "port" : 7005
                }
        ],

        "DataStoreType" : "redis",

        "RedisStatsServer":
        {
                "server" : "127.0.0.1",
                "port" : 6379,
                "password" : "redis123"
        },

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

   RedisServers节点:这是要监控的主机列表,可以添加多个
   进入RedisStatsServer节点:这是要将监控数据放到哪里,一般是RedisLive运行的机器,是一个将数据采集到本地临时存储的一个Redis。
5、启动监控,并访问
   开启监控脚本:./redis-monitor.py --duration 120 &
   ./redis-live.py &

   在浏览器中输入如下地址来查看RedisLive:http://localhost:8888/index.html

6、监控需要注意
   (1)如果在浏览器调入地址后出现无法访问的现象请关闭防火墙或者开端口8888。

   (2)监控开启后会影响到Redis的性能,所以建议定时监控而不是实时监控。

   (3)定时运行nohup ./redis-monitor.py --duration=秒数 &

      注:做采样时,请合理配置采样秒数;系统定时运行采样脚本的频率建议不要太频繁
  
  

猜你喜欢

转载自zyx870805.iteye.com/blog/2306873