Procedure 1 Download the installation package

Official website address:https://redis.io/download

2 the installation

2.1 Download the installation package to the VM using a remote tool and log in to the VMcd /optView in directory



2.2 Decompressing the installation package

tar -zxvf redis-5.08..tar.gz
Copy the code

The folder appears after decompressionRedis - 5.0.8:



2.3 Accessing the Redis Directory

cd redis-5.08.
Copy the code



2.4 inRedis - 5.0.8Directory executionmakeThe command

(because this step is more content, so only the last part of the interception, for reference only 🙂



note: Here’s a prompt (in the purple box), let’s do itmake testCommand to test, this sentence can be ignored.

2.5 If make is complete, run the command againmake install

2.6 Viewing the Default Installation Directory

usr/local/bin
Copy the code



2.7 start

So let’s create onemyredisFolder. Then go to the opt directory and Redis directory. Back up the factory default configuration files (the ones in the purple box)



Backup command:

cp redis.conf /myredis/
Copy the code

Take a look after the backup:



Enter theRedis.conf in myredis, edit the configuration filedaemonize notodaemonize yes.



Check whether the redis service has been started in the background. As shown in the figure, mine has been started and the default port number is6379.

ps -ef|grep redis
Copy the code



If the command is not started

 cd /usr/local/bin/
 redis-server
Copy the code

After the startup is successful, go to the bin directory and enterping, returns aPONG

2.8 Forever HelloWorld

2.9 shut down

SHUTDOWN
Copy the code



After closing the service, check the background process again and find that no Redis service is started.