The preparatory work

Download the Redis

  1. Download the latest stable Redis version 6.2.1 from the official Redis download site.
  2. Use WinSCP to upload the file/usr/local/Directory.

Install Redis

Unpack the

Use XShell to go to /usr/local/ and run tar ZXVF to decompress the package.

The tar ZXVF redis - 6.2.1. Tar. GzCopy the code

Go to the decompressed directory to compile.

If GCC is not installed, run the yum install GCC command to install GCC.

[root@iZbp1a30f9quwpuofd5v7aZ local]# cd redis-6.2.1/
[root@iZbp1a30f9quwpuofd5v7aZ redis-6.2.1]# make
Copy the code

Enter the SRC directory and run Redis.

[root@iZbp1a30f9quwpuofd5v7aZ src]# ./redis-server
Copy the code

This means that the service is not started as a daemon using the default configuration.

The configuration file

Conf is the configuration file in the Redis root directory.

# bind 127.0.0.1 -::1 # comment line allow external access to protected-mode no # daemonize yes # daemon enabled requirepass yourpassword # set passwordCopy the code

Start with a configuration file

[root @ iZbp1a30f9quwpuofd5v7aZ SRC] #. / redis server/usr/local/redis - 6.2.1 / redis. ConfCopy the code