Install Redis on Linux (CentOS7)


Since a C language compiler is required to compile the installation package, to install gcc, first execute the gcc -v command to check whether it is installed

If the installation is not successful, execute yum install -y gcc

Check the gcc version again, the installation is successful


Execute the wget command to download the compressed package

Found that the wget command is not installed, execute the yum install -y wget command to install wget.

Then execute the command to download the redis compressed package above


Execute the tar -xvf redis-5.0.3.tar.gz command to decompress.

Switch to the unzipped directory cd redis-5.0.3

Then execute the make command to compile

Execute make install PREFIX=/usr/local/redis to install to the specified directory

Note: Don’t panic when the above prompt appears, the installation has been successful, you can see it in the /usr/local/ directory

At this point, the installation is complete, and then you can start.

start up

Execute the cd /usr/local/redis/bin/ command to enter the bin directory of redis

You can see the same redis-cli and redis-server files in the Windows system, this is the startup file

redis-server is to start the redis service; redis-cli is to start the client connection.

First execute ./redis-server to start the redis service

Create a new session (you must open a new session, because the original session will not end after opening the service) execute the ./redis-cli command to start the redis client connection, and you can operate the redis database

In addition to using the command to start, you can also specify the configuration file to start.