CentOS 7.3 Installation Redis 4.0.2 service

Source: Internet
Author: User
Tags redis
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

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.