溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

redis監(jiān)控工具redis live怎么安裝

發(fā)布時(shí)間:2021-11-15 10:25:32 來源:億速云 閱讀:133 作者:小新 欄目:開發(fā)技術(shù)

這篇文章主要為大家展示了“redis監(jiān)控工具redis  live怎么安裝”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“redis監(jiān)控工具redis  live怎么安裝”這篇文章吧。

時(shí)間有限,只能簡(jiǎn)單列出安裝步驟

可以參考Redis live官方文檔

http://www.nkrode.com/article/real-time-dashboard-for-redis

1.安裝pip

wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" --no-check-certificate

  tar xf pip-1.5.4.tar.gz 

  cd pip-1.5.4

  python setup.py install

2.安裝redis live依賴

安裝依賴 tornado redis模塊  python-dateutil,argparse(python版本小于2.7就需要這個(gè))

 Install Dependencies

· tornado pip install tornado

· redis.py pip install redis

· python-dateutil pip install python-dateutil

You'll also need argparse if you're running Python < 2.7:

· argparse pip install argparse

3.安裝redis live

wget https://codeload.github.com/nkrode/RedisLive/legacy.zip/master

解壓到/application/tools

進(jìn)入到解壓目錄下的src目錄下

vim redis-live.conf 沒有可以將src目錄下的redis-live.conf.example 復(fù)制一份

{
    "RedisServers":
    [

//此處配置的是redis的地址及端口 多個(gè)可以按照下面的格式,{}添加
        {
            "server": "192.168.14.192",
            "port" : 6379
        }
    ],
                                                  
    "DataStoreType" : "sqlite",//172.16.0.70采用的是sqlite
     //如果DataStoreType是用redis 不是用  sqlite 就用配置     RedisStatsServer                                    
    "RedisStatsServer":
    {
        "server": "192.168.14.192",
        "port" : 6381
    },
 //如果DataStoreType不是用redis是用sqlite 就要配置SqliteStatsStore                                             
    "SqliteStatsStore":
    {
        "path": "/opt/portal/RedisLive/src/db/redislive.sqlite"
    }
}

RedisServers為你要監(jiān)控的redis實(shí)例,可以添加多個(gè)
如果redis有密碼,可以在實(shí)例配置中加入password選項(xiàng);


DataStoreType決定使用那種類型的數(shù)據(jù)存儲(chǔ),(推薦用sqlite)
如果是redis,使用RedisStatsServer作為數(shù)據(jù)存儲(chǔ)的目標(biāo);(配置的redis 不要是被監(jiān)控的,所以還是推薦用sqlite)
如果是sqlite,使用SqliteStatsStore作為數(shù)據(jù)存儲(chǔ)的目標(biāo)。


RedisStatsServer是用于存儲(chǔ)RedisLive監(jiān)控?cái)?shù)據(jù)的redis實(shí)例,
if you don't have a spare redis instance to use to store RedisLive data, then you can configure RedisLive to use sqlite by changing to "DataStoreType" : "sqlite"


RedisLive的功能分兩個(gè)部分:
一個(gè)部分是redis-server狀態(tài)數(shù)據(jù)的采集,通過src/redis-monitor.py來執(zhí)行;
另外一部分功能是提供對(duì)狀態(tài)數(shù)據(jù)的查詢服務(wù),通過src/redis-live.py來提供web服務(wù)。

初始化DB(必須的,否則報(bào)錯(cuò))

# cd db
# cat schema.sql | sqlite3 redislive.sqlite

后臺(tái)啟動(dòng)

*/5 * * * * cd /application/tools/nkrode-RedisLive-6debcb4/src; ./redis-monitor.py --duration 20 >/dev/null 2>&1

nohup ./redis-live.py & >/dev/null 2>&1

以上是“redis監(jiān)控工具redis  live怎么安裝”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI