How to install redis under linux

Redis download address https://redis.io/download

1. Upload the downloaded redis installation package to linux through sftp, and create a new redis folder to decompress the redis installation package


2. If gcc is not installed on linux, install the compilation environment through the yum install gcc-c++ command (requires networking)

3. Enter the redis-3.0.0 root directory and enter the make command to compile


If the following picture appears, the compilation is successful.


4. After compiling, install to the specified path (PREFIX=**) and specify the path by yourself


5. After the installation is complete, go to the installation directory, you can see an additional bin directory, enter the bin directory, redis-cli is the redis client execution file, and redis-server is the redis server execution file.



6. Execute redis-server to start the redis server. The following picture appears to indicate that the startup is successful. The default port number is 6379. The startup mode at this time is the front-end enable mode. This mode must occupy a terminal, and the service will stop when the terminal is closed.


7. Start the redis mode in the background, enter the redis-3.0.0 directory to find the redis.conf file, and copy the file to the bin directory


8. Modify the redis.conf file, vim redis.conf, find the daemonize no section and change the no to yes, and you can start it in the background. The background start command is

./redis-server redis.conf.



9. You can view the process of redis through the following command


10. Open the redis client to test the redis service.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324719493&siteId=291194637