• How to install Redis under Widows

*(1). Download address:Click the jump. As shown below:*(2). After the download is successful, move it to the directory we want to install and decompress it: as shown below:*(3). After entering:*(4). First click redis-server.exe to start redis service, the display is as follows:

*(5). Then click Redis -cli.exel to connect to Redis, as shown below:*(6). At this point, the installation under Windows is complete. However, the official Document of Redis does not suggest that we set up Redis service under Widows. It is best to set up and use Redis service on Linux!

2. How to install Redis on Linux? The premise condition: the Linux system I installed here is CentOS7.7, and it is a cloud server. The remote tool I use is Xshell 6. *(1). First download the installation package, download the address:Click the jump. As shown below:*(2). Generally, we install these services under the specified folder, create a soft folder under the /opt directory, and then create the service name folder we need to install under the /soft file, redis: as shown in the figure:*(3). Upload the package to the redis folder on the remote server by rZ command: as shown below: *(4). Wait for the upload to succeed, the speed generally depends on your server bandwidth: then decompress the Redis installation package: command:Tar -zxvf Name of the package to be decompressed *(5). After decompression, enter the folder. Under normal circumstances, there are 19 files after decompression, if not, please delete and decompress again:*(6). Next we install base environment GCC, install command:yum install gcc-c++ Wait for the installation to complete, entergcc -vTo view the current version of GCC:*(7)Focus onWe installed Redis version 6.0.10. There are some requirements for the GCC environment, so we need to upgrade GCC by typing the following command:

The first step #
sudo yum install centos-release-scl
Step # 2
sudo yum install devtoolset-7-gcc*
Step # 3
scl enable devtoolset-7 bash
Copy the code

Don’t worry too much about input, just say yes. As shown below:

If the version changes to 7.3.1, the environment is successfully upgraded.

*(8). Then run the following command in the redis directory:makeIf the following information is displayed, make download successfully!Then run the following command:make install, installation file!*(9). You will notice that we do not specify the installation path, but Redis does have a default path. Remember:

/usr/local/bin
Copy the code

Enter this folder, you can find that there are two files and we are the same as the files under Windows, respectively when starting and connecting.*(10). We will copy the configuration file and use this configuration file to start the Redis service. Command:Cp/opt/soft/redis/redis - 6.0.10 / redis. Conf mtconfig / *(11). Redis is not started in background by default, modify the configuration file!

Open the configuration file
vim redis.conf
# save
wq!
Copy the code

Times 12, and then it’s going to be. Start and connect to the Redis service!

Start the Redis service
redis-server mtconfig/redis.conf
# Connect to redis service
redis-cli -p 6379
Copy the code

*(13). Test redis service: first test set and get basic operations:Redis service process:

And you’re done! Since then, the installation of Redis is complete! Welcome to watch reprint please indicate the source