1. Download Redis 6.2.1 redis-6.2.1.tar.gz from the official website: https://redis.io/, you can also go to https://download.redis.io/releases/ to download, the speed is quite slow
2. Enter the /opt directory
cd /opt
3. Unzip redis-6.2.1.tar.gz
tar -zxvf redis-6.2.1.tar.gz
4. Install the c language environment (you can skip it if you have already installed it)
yum install centos-release-scl scl-utils-build
yum install -y devtoolset-8-toolchain
scl enable devtoolset-8 bash
Test gcc version
gcc --version
5. Enter the redis-6.2.1 directory
cd redis-6.2.1
6. compile
make
7. Execute the installation
make install
8. Enter the bin directory and use the foreground to start the test to see if the installation is successful
cd /bin
redis-server
This interface appears even if it is successful, use control+c to stop the redis process
9. Set background startup
(1) Enter the redis-6.2.1 directory
cd /opt/redis-6.2.1
(2) Copy the redis.conf file to the /etc directory
cp redis.conf /etc/redis.conf
(3) Enter the /etc folder
cd /etc
(4) Modify the redis.conf file
vi redis.conf
(5) Change daemonize no to yes in the background startup setting, and you can search for this statement by typing /dae
Find daemonize no and change it to yes
Save changes
(6) Enter the /usr/local/bin directory
cd /usr/local/bin
(7) Enter redis-server /etc/redis.conf to start redis in the background
redis-server /etc/redis.conf
At this point, you can enter redis-cli for client access
Enter ping, return PONG to indicate that the connection has been normal
(8) In redis-cli state, enter shutdown to close redis
Finish