Home >Database >Redis >How to configure remote connection in redis

How to configure remote connection in redis

尚
forward
2020-03-07 09:27:118381browse

How to configure remote connection in redis

Redis only supports local use by default. How to enable remote connection and remotely access the remote redis server?

General steps to open a remote connection:

1. Shield local binding information

2. Add requirepass

3. Restart redis

4. Add the redis port to the firewall rules

Next look at the detailed process

Comment redis binding

Modify the redis configuration file

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

Search bind 127.0.0.1 Comment out all

How to configure remote connection in redis

Set requirepass

requirepass field is actually the auth password for the redis connection

Set as shown in the picture

How to configure remote connection in redis

Restart reids

service redis-server restart

How to configure remote connection in redis

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

How to configure remote connection in redis

For more redis knowledge, please pay attention to the PHP Chinese websiteredis tutorial column.

The above is the detailed content of How to configure remote connection in redis. 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