redis download and installation (in Linux environment)

The deepin os Linux system of Alibaba Cloud is used

One, download

Type the command:

wget http://download.redis.io/releases/redis-6.2.1.tar.gz

There is a gcc environment when checking

gcc --version

If there is a gcc environment, there will be a prompt similar to the following figure

If not, execute:

yum install gcc

After the download is complete, execute the ls command

 decompress redis

tar -zxvf redis-6.2.1.tar.gz

 ls to view the directory. Enter the directory redis-6.2.1

 Execute the make command to compile, and then execute make install to install, the default installation directory /usr/local/bin, let's cd in and have a look

Two, start

Foreground start (not recommended)

Excuting an order:

redis -server

 The startup is complete as shown in the figure below

 But it is not recommended to write this way, because just closing this interface is equivalent to closing redis, and this interface cannot be operated

background start

Find redis-6.2.1, enter, and execute

vi redis-conf

Modify daemonize to yes

Attach the linux modification file

1. Enter the file:vi 文件名

vi redis.confg

2. Find the location of the content to be modified 

Enter / + query content (eg query Directory parameters, ie /Directory)

/daem

3. Modify after finding the position: press the i key on the keyboard to become editable

4. Save the modification :

(1) alt+":" to make the file queryable

(2) Enter wq!

continue with the steps above

Enter the /usr/local/bin directory and execute

redis-server /root/redis-6.2.1/redis.conf

View redis status

ps -ef | grep redis

 You can start the redis-cli client

Enter the command: redis-cli

Three, redis is closed

1. Enter shutdown directly 

shutdown

2. Find the process number and use the kill command

ps -ef | grep redis

kill -9 7755 

Guess you like

Origin blog.csdn.net/Yajyaj123/article/details/126917745