Redis installation, and supervisor process management for it to run, close, etc.

Source: Internet
Author: User
Tags redis
1: Download
wget http://download.redis.io/releases/redis-3.2.8.tar.gz

Download the specified version, you can log in Https://redis.io/download view 2: Install

Tar zxvf redis-3.2.8.tar.gz
cd redis-3.2.8
make
sudo make install

The Redis executable was then placed in/usr/local/bin 3: Configuration

sudo mkdir/etc/redis
sudo cp redis.conf/etc/redis/6379.conf
sudo cp utils/redis_init_script/etc/redis/
4: Run and close
Cd/etc/redis
#使用root权限运行
sudo./redis_init_script start
#再打开一个终端, execute the following command to close the Redis
Cd/etc/redis
./redis_init_script stop
#也可以通过redis客户端关闭
redis-cli shutdown
5: Monitor process with supervisor
#先打开supervisor配置文件
sudo vi/etc/supervisord.conf

Add code at the end of a file

[PROGRAM:REDISD]
; Command=/etc/redis/redis_init_script start
; it is not possible to start the Redis process in this way, in this way, supervisor is monitoring the script redis_init_script, Rather than Redis
command=/usr/local/bin/redis-server/etc/redis/6379.conf
stdout_logfile=/var/log/supervisor/ Redis.log
stdout_logfile_maxbytes=1mb
stdout_logfile_backups=10
username=root
password=root_ Password
6: Update supervisor Configuration
sudo supervisorctl update

Redis Service is now running in the background 7: Turn off Redis

In the supervisord.conf file, the [PROGRAM:REDISD] flag means that the Redis service is managed using REDISD (with a letter D appended to the Redis) to operate.
Therefore, there are several ways to turn off the Redis service:

sudo supervisorctl stop REDISD
#或者通过redis客户端的方式关闭
redis-cli shutdown
8: Restart again
Supervisorctl Start REDISD

For more supervisor operations, please see:
Linux Process management Tools Supervisor http://blog.csdn.net/win_turn/article/details/60466562

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.