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