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.