安裝redis live監控工具

來源:互聯網
上載者:User


EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社區打造,為 RHEL 及衍生髮行版如 CentOS、Scientific Linux 等提供高品質軟體包的項目。

首先安裝epel擴充源:

sudo yum -y install epel-release
然後安裝python-pip
sudo yum -y install python-pip

安裝完之後別忘了清除一下cache

sudo yum clean all
用pip安裝一下外掛程式:

pip install tornadopip install redispip install python-dateutilpip install argparse


# cd RedisLive/src

# vim redis-live.conf

{    "RedisServers":    [        {            "server": "172.17.138.180",            "port" : 6379,            "password" : "tenredis2356"        },                                                              {            "server": "172.17.132.228",            "port" : 6379,            "password" : "tenredis2356"        }    ],                                                      "DataStoreType" : "sqlite",                                                      "RedisStatsServer":    {        "server" : "127.0.0.1",        "port" : 6381    },                                                      "SqliteStatsStore":    {        "path": "/data/Redis-Monitor/RedisLive/src/db/redislive.sqlite"    }}


在RedisServers中設定需要監控的redis-server;


DataStoreType決定使用那種類型的資料存放區,
如果是redis,使用RedisStatsServer作為資料存放區的目標;
如果是sqlite,使用SqliteStatsStore作為資料存放區的目標。


RedisLive的功能分兩個部分:
一個部分是redis-server狀態資料的採集,通過src/redis-monitor.py來執行;
另外一部分功能是提供對狀態資料的查詢服務,通過src/redis-live.py來提供web服務。

配置定期監控  、 啟動:

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

開放8888連接埠:

sudo vi /etc/sysconfig/iptables

加入一行:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8888 -j ACCEPT

sudo service iptables reload

開啟地址:

http://172.16.10.109:8888/index.html




相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.