#1.gcc编译环境确认
gcc -v
如果没有gcc环境,请安装gcc
yum 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.7
tar -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
编译setuptools
python 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.gz
tar 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