Home  >  Article  >  Database  >  Detailed explanation of the method of redis configuring remote connection

Detailed explanation of the method of redis configuring remote connection

尚
forward
2019-11-29 16:22:524250browse

Detailed explanation of the method of redis configuring remote connection

Redis only supports local use by default. How to enable remote connection and remotely access the remote redis server (recommended: redis introductory tutorial)

General steps for opening a remote connection

1. Shield local binding information

2. Add requirepass

3. Restart redis

4. Change the redis port Add firewall rules

Next look at the detailed process

Comment redis binding

Modify redis configuration file

vi /usr/ local/redis/etc/redis.conf

Search for bind 127.0.0.1 and comment out all

Detailed explanation of the method of redis configuring remote connection

##Set requirepass

requirepass field is actually the auth password of the redis connection

The setting is as shown in the figure

Detailed explanation of the method of redis configuring remote connection

Restart reids (recommended: redis video Tutorial)

service redis-server restart

Detailed explanation of the method of redis configuring remote connection

Add firewall rules

iptables -I INPUT -p tcp -m state –state NEW -m tcp –dport 6379-j ACCEPT

Here you can connect to redis remotely

Detailed explanation of the method of redis configuring remote connection

The above is the detailed content of Detailed explanation of the method of redis configuring remote connection. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete