Home > Database > Redis > body text

How to configure remote connection in redis

Release: 2020-03-07 09:27:11
forward
8312 people have browsed it

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
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!