標籤:
#1.
gcc編譯環境確認gcc -v如果沒有gcc環境,請安裝gccyum install gcc#2.
openssl安裝yum install openssl -y
yum install openssl-devel -y
#3.
sqlite安裝yum install sqlite-devel -y
#4.
zlib安裝
yum install zlib
yum install zlib-devel
#5.
CentOS升級Python到2.7tar -xvf Python-2.7.3.tgz
cd Python-2.7.3
./configure
make
make install
#接下來需要建立一個連結來使系統預設python變為python2.7
ln -fs /usr/local/python2.7/bin/python2.7 /usr/bin/python
#運行python查看版本
python -V
#變更後,yum如果無法運行了#修改/usr/bin/yum檔案,將第一行的 #!/usr/bin/python 改為系統原有的python版本,如下:
#!/usr/bin/python2.6
#6.
基礎環境安裝
下載setuptools包 wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
解壓setuptools包tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
編譯setuptoolspython setup.py build
開始執行setuptools安裝python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://pypi.python.org/packages/source/b/backports.ssl_match_hostname/backports.ssl_match_hostname-3.4.0.2.tar.gztar xvzf backports.ssl_match_hostname-3.4.0.2.tar.gz
cd backports.ssl_match_hostname-3.4.0.2
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://github.com/facebook/tornado/archive/v3.2.0.tar.gz
tar xvzf tornado-3.2.0.tar.gz
cd tornado-3.2.0
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://pypi.python.org/packages/source/r/redis/redis-2.9.1.tar.gz
tar xvzf redis-2.9.1.tar.gz
cd redis-2.9.1
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://pypi.python.org/packages/source/s/six/six-1.5.2.tar.gz
tar xvzf six-1.5.2.tar.gz
cd six-1.5.2
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz
tar xvzf python-dateutil-2.2.tar.gz
cd python-dateutil-2.2
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget http://argparse.googlecode.com/files/argparse-1.2.1.tar.gz
tar xvzf argparse-1.2.1.tar.gz
cd argparse-1.2.1
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
#7.RedisLive安裝 https://codeload.github.com/nkrode/RedisLive/zip/master
unzip RedisLive-master.zip
mv RedisLive-master RedisLive
#8.RedisLive配置
cd RedisLive/src
vi redis-live.conf
在RedisServers中設定需要監控的redis-server;
DataStoreType決定使用那種類型的資料存放區,
如果是redis,使用RedisStatsServer作為資料存放區的目標;
如果是sqlite,使用SqliteStatsStore作為資料存放區的目標。
RedisLive的功能分兩個部分:
一個部分是redis-server狀態資料的採集,通過src/redis-monitor.py來執行;
另外一部分功能是提供對狀態資料的查詢服務,通過src/redis-live.py來提供web服務。
#9.
初始化DB
cd db
cat schema.sql | sqlite3 redislive.sqlite
#10.配置RedisLive的定期監控
cd /<your RedisLive Path>/RedisLive/src;
nohup ./redis-monitor.py --duration 20 >/dev/null 2>&1 &
#11.服務啟動
nohup ./redis-live.py &
#12.效果展示
http://192.168.40.9:8888/index.html
採用RedisLive監控Redis服務——安裝手冊