Graphical tutorial on installing redis in Linux

                                  linux中安装redis

Description:
Creator: csc
Time: 2023-04-17
Environment: My environment is Tencent Cloud Server and the operating system is OpenCloudOS Server 8.
If you have installed redis and want to access it from outside. Don’t forget to open the corresponding port of your server redis default Port: 6379
redis download address: https://download.redis.io/releases/ Please download the version you need
. Since redis is written in C language, you need to install the C compilation environment first when installing and compiling redis. The command is as follows:

  yum install gcc-c++

If you have installed redis and want to access it from outside, don’t forget to open the corresponding port of your server. The default redis port is: 6379

  1. First, you need to upload the redis.tar compressed package to your Linux system. I have created a download folder here. You are free to do so. Then
    execute the decompression command, followed by your version:
tar -zxvf  redis-6.2.8.tar.gz

Insert image description here
Go to the unzipped folder

cd redis-6.2.8

#Execute the installation command

make PREFIX=/usr/local/redis install

Execute again

make install

Do not omit this step, otherwise redis-server will report an error when running.
3. Enter the installation folder /usr/local/redis. Copy the redis.conf configuration file in the previously decompressed folder. I created a config here as shown
below :
Insert image description here

The copy command is as follows: If the respective installation paths are not accessible, please modify them yourself.

cp /download/redis-6.2.8/redis.conf  /usr/local/redis/config

Enter the config folder and modify the redis.conf file to run
Insert image description here
esc in the background. Then: wq save and exit.

Start redis and run the specified configuration file. The command is as follows:
the following is the path to your own redis.conf configuration file.

redis-server ../config/redis.conf

#Check whether redis is running.

ps -ef|grep redis
             																														end

Guess you like

Origin blog.csdn.net/qq_37120477/article/details/130192438