• Linux version: CentOS7.7
  • Redis version: 5.0.8

1. Download Redis

  • Method one: the official download address download. Redis. IO/releases/choose corresponding version download upload server.
  • Method 2:Wget HTTP: / / http://download.redis.io/releases/redis-5.0.8.tar.gz

2. Decompress and install

  1. Unzip and compile.
Tar -xvf redis-5.0.8.tar.gz CD redis-5.0.8 makeCopy the code

Yum install gcc-C ++

  1. The installation to/usr/local/redis/Directory and copy the configuration file.
cd src make install PREFIX=/usr/local/redis cd .. / mkdir /usr/local/redis/config cp ./redis.conf /usr/local/redis/config/Copy the code

3. Modify the configuration

  1. vi /usr/local/redis/config/redis.conf
#Remove local access restrictions
# bind 127.0.0.1
#Disable the protected mode; otherwise, the Internet cannot access Redis
protected-mode no
#Whether to start as a daemon
daemonize yes
Copy the code
  1. portPort can be changed can not be changed, mainly to see whether there is port conflict.

4. Start Redis

  1. Using the command/usr/local/redis/bin/redis-server /usr/local/redis/config/redis.confStart the Redis.
  2. Check the processps aux|grep redis
  3. Check the portnetstat -tnlp|grep 6379

5, stop Redis

  • usepkill redisThe command or/usr/local/redis/bin/redis-cli shutdownTo smooth down the Redis process.
  • You are not advised to run the kill command to kill processes. Otherwise, data may be lost.

6. Uninstall Redis

  • You only need to delete the installation directoryrm -rf /usr/local/redis

Refer to the link

  • Linux Install Redis complete steps

Personal website

  • Gitee Pages
  • Github Pages