1: Download
wget HTTP://DOWNLOAD.REDIS.IO/RELEASES/REDIS-3.2.8.TAR.GZ1
Download the specified version, you can log in Https://redis.io/download view
2: Installation
Tar zxvf redis-3.2.8.tar.gzcd Redis-3.2.8makesudo make install1234
The Redis executable is then placed in the/usr/local/bin
3: Configuration
sudo mkdir/etc/redissudo CP redis.conf/etc/redis/6379.confsudo CP utils/redis_init_script/etc/redis/123
4: Run and close
Cd/etc/redis1
#使用root权限运行sudo./redis_init_script start12
#再打开一个终端, execute the following command to close Rediscd/etc/redis./redis_init_script stop123
#也可以通过redis客户端关闭redis-cli Shutdown12
5: Monitor process with supervisor
#先打开supervisor配置文件sudo VI/ETC/SUPERVISORD.CONF12
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, supervisor is monitoring scripts Redis_ Init_script, not rediscommand=/usr/local/bin/redis-server/etc/redis/6379.confstdout_logfile=/var/log/supervisor/. redis.logstdout_logfile_maxbytes=1mbstdout_logfile_backups=10username=rootpassword=root_password123456789
6: Update Supervisor Configuration
sudo supervisorctl update1
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 REDISD1
#或者通过redis客户端的方式关闭redis-cli Shutdown12
8: Restart again
Supervisorctl Start REDISD1
For more supervisor operations, please see:
Linux Process management Tools Supervisor http://blog.csdn.net/win_turn/article/details/60466562
[2]supervisor Use management: Implements an automatic restart of an abnormally interrupted subprocess (for Redis, for example)