使用Redis Live监控Redis服务器

2019-05-30  本文已影响0人  十毛tenmao

Redis服务器运行时,即使服务正常,我们也需要连接Redis服务期间的情况,比如内存消耗,命令处理等指标。Redis Live是开源的Redis监控套件,包含监控与Web服务。

安装

# 安装依赖
pip install tornado
pip install redis
pip install python-dateutil

# 下载RedisLive
wget https://github.com/kumarnitin/RedisLive/zipball/master -O RedisLive.zip
unzip RedisLive.zip
mv nkrode-RedisLive-e1d7763 RedisLive

配置

cd RedisLive/src
mv redis-live.conf.example redis-live.conf

redis-live.conf

{
    "RedisServers": [
        {
            "server": "192.168.58.100",
            "port": 6379,
            "password": "tenmaopass"
        },
        {
            "server": "192.168.58.101",
            "port": 6379,
            "password": "tenmaopass"
        }
    ],
    "DataStoreType": "sqlite",
    "SqliteStatsStore": {
        "path": "/home/tenmao/RedisLive/src/db/redislive.sqlite"
    }
}

这里使用sqlite作为数据库,而不是使用另外一个redis,以免容易弄混淆

启动

./redis-monitor.py --duration=120
./redis-live.py

http://localhost:8888/index.html

RedisLive页面

注意事项

因为redis-monitor.py执行中会影响Redis的吞吐率,所以需要根据实际情况调整参数--duration

常见问题

参考

上一篇 下一篇

猜你喜欢

热点阅读