Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use RedisLive to monitor Redis server

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of "how to use RedisLive to monitor Redis server". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use RedisLive to monitor Redis server" can help you solve the problem.

RedisLive is a graphical monitoring tool written by python and open source, very lightweight, the core service part only contains a web service and a monitoring service based on redis's own info command and monitor command, the interface is only a BootStrap-based web interface, very simple and clear. In addition, it also supports multi-instance monitoring, easy to switch, and very easy to configure. Monitoring information supports both redis storage and persistent storage (sqlite).

Installation

RedisLive is implemented using Python and uses Tornado as its own Web server. No additional compilation process is required to run RedisLive. After downloading the RedisLive code, you can run it directly as long as you install the dependent Python extension pack. You can download the latest RedisLive source code at Git:

Git clone https//githup.com/kumarnitin/RedisLive.git

After entering the downloaded RedisLive directory, you can see that the Python expansion packs that RedisLive depends on have been written in the requirements.txt file. The requirements.txt is as follows:

Argparse==1.2.1python-dateutil==1.5redistornado==2.1.1

Friends who are familiar with Python must also feel friendly to the requirements.txt file. Use the following command to install the expansion package (specify Douban source to install faster):

Pip install-r requirements.txt-I http://pypi.douban.com/simple/ run in Murray host pypi.douban.com

Once the dependencies are installed, you can run RedisLive. Go to the RedisLive/src directory and you can see the redis-live.conf.example file, which is a sample configuration file for RedisLive and contains the following contents:

RedisServers: a list of monitored Redis instances. RedisLive supports monitoring multiple Redis instances RedisStatsServer: Redis instances used to store monitoring data. This configuration is different from RedisServers,RedisLive, which is not used to store monitoring data. RedisStatsServer,RedisStatsServer is not only used to store monitoring data. Use DataStoreType: storage scheme for monitoring data, which can be configured as redis or sqliteSqliteStatsStore: sqlite configuration for storing monitoring data.

The redis-live.conf used by our example (the suffix .example needs to be removed) is set as follows:

That is, the monitored Redis instance is 127.0.0.1 sqlite 6379, and the monitoring data scheme is stored using sqlite. After the configuration of db/redislive.sqlite database path for RedisLive is completed, RedisLive can be run. The operation of RedisLive consists of two parts (in the RedisLive/src directory), redis-monitor.py is used to send INFO and MONITOR commands to the Redis instance and get its return, and redis-live.py is used to run the Web server.

We first start the redis-monitor.py script and set the duration parameter to 120 seconds. The duration parameter specifies the running duration of the monitoring script. For example, it is set to 120 seconds, that is, after 120 seconds, the monitoring script automatically exits and prints shutting down on the terminal. A hint.

. / redis-monitor.py-- duration=120

Next, start the Web server:

. / redis-live.py

Open the browser, enter http://localhost:8888/index.html in the address bar, press enter, and you can see the monitoring data of the Redis instance.

It should be pointed out that because the redis-monitor.py script obtains the monitoring data by sending MONITOR commands and INFO commands to the Redis instance, and the MONITOR command has a great impact on the performance of the Redis instance, for the deployment of redis-monitor.py in the production environment, you need to set a more appropriate duration parameter and use crontab to execute the script regularly.

This is the end of the introduction to "how to use RedisLive to monitor Redis servers". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report