RedisLive installation configuration

Posted by free2code on Sat, 02 May 2020 08:38:18 +0200

Installation environment: CentOS release 6.5 (Final) 64 bit

1. Install Python
Python 2.6 comes with CentOS, but pip does not support this version. You need to upgrade Python to 2.7 first, and python 2.6 is required for yum, so Python needs to coexist with 2.6 and 2.7

# Install compilation tools and dependency Libraries
yum groupinstall 'Development tools'
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

# Installing Python 2.7
wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xz
unxz Python-2.7.14.tar.xz
tar xvf Python-2.7.14.tar.xz
cd Python-2.7.14
./configure
make
make altinstall

At this time, python 2.6 is used to execute Python 2.6 and python 2.7

2. Install the pip dependency tool setuptools

wget https://pypi.python.org/packages/41/5f/6da80400340fd48ba4ae1c673be4dc3821ac06cd9821ea60f9c7d32a009f/setuptools-38.4.0.zip#md5=3426bbf31662b4067dc79edc0fa21a2e
cd setuptools-38.4.0
python2.7 setup.py install

Perform easy install test installation, if it appears

error: No urls, filenames, or requirements specified (see --help)

Installation succeeded

3. Install pip

wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
tar zxvf pip-9.0.1.tar.gz
cd pip-9.0.1
python2.7 setup.py install

If last output

Finished processing dependencies for pip==1.5.5

Installation is complete

4. Install RedisLive dependencies

# Install the web server tornado in Python
pip install tornado
# Install the Python SDK of redis
pip install redis
# Installation time tool
pip install python-dateutil

root permission is required for installation here. Otherwise, an error is reported. The information is as follows:

error: could not create '/usr/lib/python2.7/site-packages/backports': Permission denied

5. Install RedisLive

RedisLive source address: https://github.com/nkrode/RedisLive

# Download and unzip
wget https://github.com/nkrode/RedisLive/archive/master.zip
unzip master.zip

# To configure
cd RedisLive-master/src
cp redis-live.conf.example redis-live.conf

RedisLive profile is as follows:

{
        "RedisServers":
        [ 
                {
                        "server": "154.17.59.99",
                        "port" : 6379
                },

                {
                        "server": "localhost",
                        "port" : 6380,
                        "password" : "some-password"
                }
        ],

        "DataStoreType" : "redis",

        "RedisStatsServer":
        {
                "server" : "ec2-184-72-166-144.compute-1.amazonaws.com",
                "port" : 6385
        },

        "SqliteStatsStore" :
        {
                "path":  "to your sql lite file"
        }
}

The whole configuration is a json object, in which RedisServers are the redis server information to be monitored, and there can be multiple; DataStoreType is the storage mode of monitoring information, and the options are redis and sqlite, respectively corresponding to RedisStatsServer and SqliteStatsStore

6. Start service

Turn off the firewall before starting the service, otherwise you will not be able to access the web page

# Start monitoring, duration specifies the heartbeat time
python2.7 redis-monitor.py --duration=30 &
# Start web service, default port is 8888
python2.7 redis-live.py &

It can be accessed through browser after startup http://ip:8888/index.html View monitoring information

reference material:

Upgrade Python's pit on CentOS
Install setuptools and pip
RedisLive: a graphical monitoring tool for redis operation status
Monitoring Redis cluster service with RedisLive
Redis live - RedisLive

Topics: Python Redis pip CentOS