CentOS 7.3 Installation Redis 4.0.2 service
1, download decompression
Download Address:/home/xiaoming/
wget http://download.redis.io/releases/redis-4.0.2.tar.gz
Extract Files
Tar zxvf redis-4.0.2.tar.gz
2, installation
1 Ensure the environment has been installed GCC and TCL
You can install GCC using yum install gcc; use yum install Tcl installation tcl
2 Execute make and make install commands
Switch to the Redis folder, execute make command, after execution completes;
Switch to execute make install command when REDIS-4.0.2/SRC path;
After execution, follow the prompts to execute the make Test command and the test is fine, the installation is successful.
3. Configure Redis
1) Remote access
Comment out IP binding #bind 127.0.0.1
Protected-mode no set to No
2) Background operation
Set Daemonize Yes
3) Password access
Set Requirepass YourPassword
4) port number
Default is 6379:port 6379
4, configure Redis boot
Copy the Redis_init_script script under the Redis-4.0.2/utils directory to/ETC/INIT.D and modify the name to REDIS:CP Redis_init_script/etc/init.d/redis.
Edit the new Redis file. Add comment to file head position:
# as it does use of THE/PROC filesystem
# chkconfig:2345 90 10
# Description:redis is a persistent key-value database
Copy the redis.conf file under the redis-4.0.2 folder to the/etc/redis directory:
Mkdir/etc/redis
CP redis.conf/etc/redis/6379.conf
Add executable permissions to/etc/init.d/redis
chmod +x/etc/init.d/redis
Chkconfig Redis on
5, Redis startup and shutdown
Start: Service Redis start
OFF: Service Redis stop
Note: If you set a password, you need to turn off the service by using the following command:
/usr/local/bin/redis-cli-h 127.0.0.1-p 6379-a yourpassword shutdown
Reference Blog: http://blog.csdn.net/yaoyuncn/article/details/50817188;http://blog.csdn.net/javaleekoy/article/details/52583932