Monitoring Redis database Application Status: Python,tornado implementation

Source: Internet
Author: User
Tags git clone install redis redis server

The company's recent Redis server pressure is growing, the approximate situation, only from the operating system level, not exhaustive, so colleagues in the Internet to find a called redis-live Open source project, I cooperated with the deployment of a bit, really a little meaning, and solved some of the small debug, In the original, more and more nosql businesses are being used here, but there is little to monitor. Today, we introduce a few professional tools to monitor Redis service, so that we could perform redis performance analysis. Here's how to install Redis-live: Because Redis-live is developed based on Python, you first need to deploy the required Python environment 1.wget http://dl.fedoraproject.org/pub/epel/6/ X86_64/PYTHON-PIP-0.8-1.EL6.NOARCH.RPM2.RPM-IVH Python-pip-0.8-1.el6.noarch.rpm3.pip-python Install Tornado4.pip-python Install Redis5.pip-python install Python-dateutil6.pip-python install argparse Environment after the deployment is finished, You need to start installing the software. git clone https://github.com/kumarnitin/RedisLive.gitInitialized empty Git repository In/root/redislive/.git/remote: Counting objects:715, Done.remote:Compressing objects:100% (377/377), Done.remote:Total 715 (Delta 338), reused 699 (d ELTA 323) receiving objects:100% (715/715), 2.59 MiB | 353 kib/s, done. Resolving deltas:100% (338/338), done. Because there is no packaged installation package, you can only download git-installed source code.                 After installation, you can configure: cd REDISLIVE/SRCVI redis-live.conf{"Redisservers": [{ "Server": "127.0.0.1", "Port": 6379}], "Datastoretype": "SQLite", "Redisstatsserver": {"Server": "127.0.0.1", "Port": 6381}}redisservers This is the configuration of the Redis server. Redisstatsserver is the monitoring information for Redis servers that can be stored in other Redis servers. That is Redisstatsserve. The general is to change the "Datastoretype" to the type of SQLite,                The following redisstatsserver do not have to be configured. Note: Because some Redis server is required to access the password, so if you have a password, you need to write the password in redisservers: "Redisservers": [ {"Server": "127.0.0.1", "Port": 6379, "password": "xxxxx X "}], after configuration, you can start the service./redis-monitor.py–duration &./redis-live.py & Note: After you start the service, if you access the Web page's The current terminal output log, if you do not want to output in the terminal, you can view the parameters of the redis-live.py [[email protected] src]#./redis-live.py--helpusage:./              redis-live.py [options]options:--help Show this help information--log_file_max_size        Max size of log files before rollover                           (default 100000000)--log_file_num_backups number of log files to keep (default 10) --log_file_prefix=path PATH prefix for log files.                                   Note that if you are running multiple tornado processes, Log_file_prefix must is different for each of the them (e.g. include the port number)-- Log_to_stderr Send log output to stderr (colorized if possible).                                   By default use stderr if--log_file_prefix are not set and no other  Logging is configured. --logging=debug|info|warning|error|none Set the Python log level.                                   If ' None ', Tornado won ' t touch the logging configuration. (default info) You can see options for log size, path, level, and so on. Finally look at the monitoring:

The deployment process encountered some problems, 1, first api/util/setting.py file to load the project root of the redis-live.conf, the author of the meaning, may want to parse the configuration file through JSON, and ultimately load as a dictionary for other function calls,  But the man-made configuration file, a variety of lines, spaces, really parse up, it is a bit troublesome. After analysis, anyway setting.py file function to invoke the dictionary, and access key I will directly change the redis-live.conf configuration to a dictionary, directly for setting.py call, Remember: setting.py  import redis_live.py need to load back the project root directory, otherwise cannot find the dictionary, import sys; sys.path.append ("root directory"). 2,api/controller/ basecontroller.py also need to import the root directory, Dataprovider, is the same problem, can not find all the modules Dataprovider, the same method to solve,

Monitoring Redis database Application Status: Python,tornado implementation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.