Centos7 under Redis installation tutorial

Source: Internet
Author: User
Tags redis redis download
Redis download Address, agreed version number The last even-numbered stable version, the odd is an unstable version, I download here is the redis-4.0.8 version of the/usr/local under the new Redis directory, will download the Redis compression package upload to/usr/local/ Unzip and install the Redis directory (note that installation Redis need to be the first of the source code to download the compilation, compilation depends on the GCC environment, if there is no GCC environment, need to install, input gcc:yum install gcc-c++ command, the command network environment available
TAR-XVZF redis-4.0.8.tar.gz
cd redis-4.0.8/
make
After make the redis-4.0.8 directory will appear after the compiled Redis service program Redis-server, as well as the client program for testing REDIS-CLI, two programs are located in the installation directory src directory. Start the Redis service and start the Redis into front-end mode startup and back-end mode startup.

1. Front-End mode start, enter the SRC directory to start the server can be

CD src/
./redis-server


The image above indicates a successful start.
Note: The current Remote Connection window (I am using Xshell) in front-end mode startup will not be able to continue entering commands, closing the window or CTRL + C will cause the service to stop and need to open another window to run the client.

2. Back-end mode startup
You need to modify the redis.conf configuration file with the SRC sibling directory, and Change daemonize no to daemonize Yes(around line 136th) to indicate that the daemon is open.

After the modification is completed, enter the SRC directory, enter the following command to open the Redis service after the end mode.

CD src/.
/redis-server. /redis.conf


Connect through the client.

-Close the Redis service, enter the SRC directory, enter the following command.

./REDIS-CLI shutdown

You can see that the client has failed to connect to the server.

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.