Redis detailed installation and configuration process on Linux

Source: Internet
Author: User
Tags redis server

This introduction under the Redis installation and detailed configuration, it is necessary to note that the local introduction is not through the Yum installation, also do not recommend that you use Yum installation , installed in fact, do not know.

1, through the RZ command to upload the local tar.gz package to the Linux server; I use redis-3.0.2.tar.gz here, upload to/home/download:

2.TAR-ZXVF command unzip the file:

3, go to the redis-3.0.2 folder to execute the make compile command,

See the following results show that everything is OK,

5, perform the Make install command for installation, I personally used to install the software into a specified directory, this installation of the directory is/home/server/redis installation directory can be built in advance:

Installation complete the same as to indicate that the installation is normal.

You can see a bin directory under the Redis directory,

6, copy the redis.conf file under the redis-3.0.2 directory to the directory Redis directory where the installation is complete:

7, in this step you can start Redis to try it out./bin/redis-server redis.conf

If you can see the same picture as Shang Ming, then congratulations on your success, but ... This interface can not do anything, CTRL + C will end the Redis (of course you can also operate in a separate window) >>>>>>

In short, how all feel is not so, then the one step below is configured

-----------------------------------------------------------------------------------Split Line----------------------------------- ------------------------------------------------------------------------------

8, here Modify the configuration file redis.conf mainly modify two places .>> vim redis.conf

1. Change the no after daemonize to Yes, meaning that the background is running (approximately 37 lines in the file)

2. Remove the # in front of the requirepass, turn on password verification, and then follow the password I set (approximately 391 lines in the file)

9. After the configuration file is repaired, we begin to talk about Redis configuration to System services:

Go back to the folder under redis-3.0.2/utils/, copy the Redis_init_script to/ETC/INIT.D and rename it to Redis

Then modify the Redis file: Modify the code to: (It may be a bit cumbersome here, post the code)

#!/bin/sh# chkconfig:2345 90## Simple Redis INIT.D script conceived to work on Linux systems# as it does use of the/p ROC filesystem. redisport=6379redispassword=wwwaaaexec=/home/server/redis/bin/redis-servercliexec=/home/server/redis/bin/ redis-clipidfile=/var/run/redis.pidconf= "/home/server/redis/redis.conf" #echo $1case "$" incli) echo "Cli R    Edis server ... "$CLIEXEC-P 6379-a wwwaaa;;        Start) If [-f $PIDFILE] then echo "$PIDFILE exists, process is already running or crashed"    else echo "Starting Redis server ..." $EXEC $CONF & fi;;        STOP) if [!-F $PIDFILE] then echo ' $PIDFILE does not exist, process was not running " Else pid=$ (cat $PIDFILE) echo $PID echo "stopping ..." $CLIEXEC-P $REDISPOR         T-a $REDISPASSWORD shutdown while [-x/proc/${pid}]       Do echo "Waiting for Redis to shutdown ..." Sleep 1 done    echo "Redis stopped" FI;; *) echo "Please use Start or stop as first argument";; Esac

The installation path is not the same as the need to modify the password is the same, and then save.

10. Adding Redis to System services: Chkconfig Redis

11 then we can start/stop Redis through the service,

12, and now you can start Redis.

The building is completed here, you can use the command to try:

Everything is ok ...... ........................

Attachment comments later upload it ~

  

Redis detailed installation and configuration process on Linux

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.