Install and use Redis under Linux

1. Enter the /usr/local directory, create a new directory redis, and download the redis installation package

wget https://download.redis.io/releases/redis-6.2.6.tar.gz

**and unzip

tar xzf redis-6.2.6.tar.gz

Enter the redis-6.2.6 directory

cd redis-6.2.6

Compile with make

make

2. Start redis: ./src/redis-server redis.conf
Start redis-cli: ./src/redis-cli

3. Close redis:

 ./src/redis-cli shutdown

4. Check the port status: netstat -tulpn
5. Modify the port of redis-cli: ./src/redis-cli -p 6380
6. Check the firewall status: firewall-cmd --state
7. Stop the firewall:systemctl stop firewalld.service
Permanently stop the firewall on port 6379. It will still take effect after restarting the virtual machine: firewall-cmd --zone=public -- add-port=6379/tcp --permanent
permanently close the firewall command: chkconfig iptables off
Insert image description here

8. Restart the firewall:firewall-cmd --reload

Guess you like

Origin blog.csdn.net/qq_41787812/article/details/133190953