Blog / Linux/ RedisLive: A Guide to Deploying and Configuring the Redis Graphical Monitoring Tool

RedisLive: A Guide to Deploying and Configuring the Redis Graphical Monitoring Tool

Introduction to RedisLive

RedisLive is an open-source, graphical monitoring tool for Redis, written in Python. It is lightweight, consisting of a web service and a monitoring service that collects data using Redis's INFO and MONITOR commands. The interface is built with Bootstrap, making it clean and straightforward. It supports monitoring multiple Redis instances with easy switching and simple configuration. Monitoring data can be stored either in Redis itself or persisted in SQLite. The project's source code is available at: https://github.com/nkrode/RedisLive.

Deployment Preparation

This guide uses CentOS as an example. Linux systems typically have Python pre-installed. Verify with:

python –V

RedisLive depends on Redis and a web service, so necessary Python packages must be installed. First, install the Python package manager pip.

Installing pip

CentOS does not include pip by default. Install it as follows:

  1. Download the pip package:
    wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
  2. Extract the file:
    tar zvxf 1.5.5.tar.gz
  3. Enter the extracted directory:
    cd pip-1.5.5
  4. Run the installation:
    python setup.py install

Successful installation will display a message like Finished processing dependencies for pip==1.5.5.

If you encounter the error ImportError: No module named setuptools, install setuptools first:

  1. Return to the home directory:
    cd ~
  2. Download the setuptools package (for Python 2.7):
    wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
  3. Execute the installer:
    sh setuptools-0.6c11-py2.7.egg

After installing setuptools, run python setup.py install again to complete pip installation.

Installing RedisLive Dependencies

Use pip to install the required Python packages:

  • Web server Tornado:
    pip install tornado
  • Redis Python SDK:
    pip install redis
  • Time utility package:
    pip install python-dateutil

Note: If your Python version is older than 2.7, also install argparse:

pip install argparse

Deploying RedisLive

Obtaining the Source Code

It is recommended to clone the repository using git:

git clone https://github.com/kumarnitin/RedisLive.git

Alternatively, manually download the ZIP file from https://codeload.github.com/nkrode/RedisLive/legacy.zip/master and upload it to your server.

Configuration File

The source directory contains a sample configuration file redis-live.conf.example. Copy or rename it to redis-live.conf:

cp redis-live.conf.example redis-live.conf

Edit redis-live.conf to configure your Redis instance information. The file is a JSON object with the following structure:

{
  "RedisServers": [
    {
      "server": "127.0.0.1",
      "port": 6379,
      "password": ""
    }
  ],
  "DataStoreType": "redis",
  "RedisStatsServer": {
    "server": "127.0.0.1",
    "port": 6379,
    "password": ""
  },
  "SqliteStatsStore": {
    "path": "db/redislive.sqlite"
  }
}
  • RedisServers: A list of Redis instances to monitor. Multiple instances can be configured.
  • DataStoreType: The storage type for monitoring data. Options are "redis" or "sqlite".
  • Configure either RedisStatsServer or SqliteStatsStore based on the chosen storage type.

Starting the Services

RedisLive consists of two core services:

  1. Monitoring Service (redis-monitor.py): Collects Redis monitoring data.
    ./redis-monitor.py --duration=30

    The --duration parameter specifies the data collection interval in seconds.

  2. Web Service (redis-live.py): Provides the graphical monitoring interface, listening on port 8888 by default.
    ./redis-live.py

After starting, access the monitoring dashboard at http://<server_ip>:8888/index.html in your browser. Use the dropdown menu in the top-right corner to switch between different Redis instances defined in the configuration file.

Notes and Updates

This guide is based on an older version of RedisLive. Please note:

  • The original project GitHub URL has been updated; some links may be outdated.
  • Modern deployments are better managed using Python virtual environments (e.g., venv).
  • For production environments, configure the services as system daemons (e.g., using systemd) to ensure stable operation.
  • RedisLive is a lightweight tool suitable for basic monitoring. For more complex needs, consider solutions like Prometheus with Grafana.

Post a Comment

Your email will not be published. Required fields are marked with *.