To open a remote connection to a redis server
Today, what the editor shares with you is the steps for redis to open a remote connection, which many people don't know much about. Today, in order to give you a better understanding of how redis opens a remote connection, I have summarized the following contents for you. Let's move on. I'm sure you'll get something.
Redis only supports local use by default. How to open a remote connection and access a remote redis server remotely?
General steps to open a remote connection:
1. Mask local binding information
2. Add requirepass
3. Restart redis
4. Add redis ports to firewall rules
Next, let's look at the detailed process.
Comment redis binding
Modify redis configuration file
Vi / usr/local/redis/etc/redis.conf
Search bind 127.0.0.1 and comment out all
Set up requirepass
The requirepass field is actually the auth password of the redis connection
The settings are shown in the figure
Restart reids
Service redis-server restart
Add firewall rules
Iptables-I INPUT-p tcp-m state-state NEW-m tcp-dport 6379MJ ACCEPT
From here, you can connect to redis remotely.
The above is a brief introduction of the steps for redis server to open a remote connection. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!