- 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
- Unzip and compile.
Tar -xvf redis-5.0.8.tar.gz CD redis-5.0.8 makeCopy the code
Yum install gcc-C ++
- 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
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
port
Port can be changed can not be changed, mainly to see whether there is port conflict.
4. Start Redis
- Using the command
/usr/local/redis/bin/redis-server /usr/local/redis/config/redis.conf
Start the Redis. - Check the process
ps aux|grep redis
- Check the port
netstat -tnlp|grep 6379
5, stop Redis
- use
pkill redis
The command or/usr/local/redis/bin/redis-cli shutdown
To 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 directory
rm -rf /usr/local/redis
Refer to the link
- Linux Install Redis complete steps
Personal website
- Gitee Pages
- Github Pages