Home >Database >Redis >How to use the Redis visual monitoring tool Redislive

How to use the Redis visual monitoring tool Redislive

PHPz
PHPzforward
2023-05-28 08:32:351198browse

RedisLive is a WEB-based Redis graphical monitoring tool written in Python. It is also an open source software that monitors Redis data in real time. It displays the key status, instance data and other information in redis in the form of WEB.

RedisLive’s address on github: https://github.com/nkrode/RedisLive

RedisLive official website English document address: http://www.nkrode.com/article /real-time-dashboard-for-redis

The principle of RedisLive is very simple, which is to use the MONITOR command provided by Redis through the monitoring script to obtain data from the monitored Redis instance and store it in the Redis monitoring instance. Do data analysis.

RedisLive displays the data in the Redis instance in a visual way, analyzing query patterns and peaks. The following picture is the official rendering:

How to use the Redis visual monitoring tool Redislive

Next, let’s install Redislive together.

1: Installation

The instructions for any software can be found in the official documentation. Let us take centos7 python as an example to illustrate the installation process. First check the python version:

How to use the Redis visual monitoring tool Redislive1. Install pip

Friends who have learned python should know that pip is a tool for installing and managing python packages. Now we can go to the official website to see Take a look at https://pypi.python.org/pypi/pip.

How to use the Redis visual monitoring tool Redislive

How to use the Redis visual monitoring tool Redislive

After downloading, we manually unzip it, then enter the root directory of pip-8.1.2 and execute: python setup.py install, but you must have root permissions to execute it. . .

How to use the Redis visual monitoring tool Redislive

Two: tornado, redis.py, python-dateutil dependencies

On the official website of redislive, we found that these three are We must install the dependencies of the redislive project before we can start our project, which is fucked up. . .

a, tornado

We can install dependencies according to the instructions on the official website, for example, execute the command: pip install tornado

How to use the Redis visual monitoring tool Redislive

b、redis.py

Then I have to install this silly thing, which is annoying to death. . . Please continue to use the pip package manager to install Redis. The command is: pip install redis

How to use the Redis visual monitoring tool Redislive

c、python-dateutil

Judging from the name, this toolkit is probably a helper tool such as util. Regardless of it, continue to use the official pip install python-dateutil

How to use the Redis visual monitoring tool Redislive

As you can see from the above Yes, the python-dateutil tool is already in Python. If you install it again, you need to update it. OK, just update it. . .

How to use the Redis visual monitoring tool Redislive

#ok, after installing it here, I am happy and excited. Finally, all the dependencies of redislive have been installed. . .

3: Download the redisLive source code

As you can see from the official website, the source code address is either git or download. Here I will choose the wget method.

How to use the Redis visual monitoring tool RedisliveHow to use the Redis visual monitoring tool Redislive

#Then manually unzip it, and this is the hanging sample. . .

How to use the Redis visual monitoring tool Redislive

But there are three very important things in redislive. . . . As shown below:

1. redis-live.conf

This is the configuration file of redislive. Open it as follows:

How to use the Redis visual monitoring tool Redislive

From the configuration file, you can probably see four important nodes:

a, RedisServers

This is the redis port we want to monitor. As can be seen from [], it can be injected One batch. . .

b, DataStoreType

We know that redisLive is a website. Since it is a website, it must also have some website data and statistical information, so we give you two options Options, either redis or sqllite. Here, just choose redis.

c、RedisStatusServer

This node is configured to specify the redis server address when you select datastoretype="redis".

d、SqliteStatusStore

This is also very simple. In the case of datastoretype="sqlite", select the sqlite server address.

Finally, the modified conf file is as follows: [For convenience, the listening server here and the statistics storage server of redislive are both on the same port. It is strongly recommended not to be the same port]

How to use the Redis visual monitoring tool Redislive

2. redis-monitor.py

This program is used to call the redis monitor command to collect redis commands for statistics, so this program must be executed permanently without Like the official website, it is set to 120s.

How to use the Redis visual monitoring tool Redislive

Here, I will set --duration=12000000, hehe~~~~

How to use the Redis visual monitoring tool Redislive

3. redis- python.py

Finally we have reached the last step, start our web site. . . Damn, driving this thing is tiring. . .

How to use the Redis visual monitoring tool Redislive

At this point, I should be able to open the site on port 8888. Are you feeling excited? Hehe. . . .

How to use the Redis visual monitoring tool Redislive

Finally, the site is open. A very beautiful interface is displayed in front of you. . . Be happy. . .

The above is the detailed content of How to use the Redis visual monitoring tool Redislive. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete