#1.gcc编译环境确认
gcc -v
如果没有gcc环境,请安装gcc
yum install gcc
yum install openssl -y
yum install openssl-devel -y
yum install sqlite-devel -y
yum install zlib
yum install zlib-devel
tar -xvf Python-2.7..tgz
cd Python-2.7.
./configure
make
make install
ln -fs /usr/local/python2./bin/python2. /usr/bin/python
python -V
#!/usr/bin/python2.
tar zxvf setuptools-.6c11.tar.gz
cd setuptools-.6c11
python setup.py build
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.2python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://github.com/facebook/tornado/archive/v3.2.0.tar.gz
tar xvzf tornado-3.2..tar.gz
cd tornado-3.2.
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://pypi.python.org/packages/source/r/redis/redis-2.9.1.tar.gz
tar xvzf redis-2.9..tar.gz
cd redis-2.9.
python setup.py install
-----------------------------------------------------------------------------------------------------------------------------------------------
wget https://pypi.python.org/packages/source/s/six/six-1.5.2.tar.gz
tar xvzf six-1.5..tar.gz
cd six-1.5.
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..tar.gz
cd argparse-1.2.
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 >/dev/null >& &
#11.服务启动
nohup ./redis-live.py &
#12.效果展示