Redis can not remotely connect solutions

I installed the pagoda redis management software, but when the connection is not always on connection, find a lot of reasons, stepped on a lot of pits, or not connected, and finally found an open port no reason, because I was outside the network connection , we need to open the appropriate ports, below, we'll show you methods.

First, redis modify configuration files, directory: /www/server/redis/redis.conf

1. bind 127.0.0.1 instead bind 0.0.0.0

127.0.0.1: representatives of local addresses, the service can only be accessed by redis client for this unit, but can not connect through Remote
0.0.0.0: accept all available connections from the network interface
Here Insert Picture Description
2. protected-mode yes instead protected-mode no

yes: protected mode, allowing only local links
no: Protected Mode turned off
Here Insert Picture Description
3. Add daemonize no (whether this is the start does not occupy a main program window in the background)

daemonize yes: on behalf of open daemon mode. At this point is a single process multi-threaded mode, redis will run in the background, and write redis.conf-pidfile pid file, then redis will always run, unless you manually kill

daemonize no: the current interface will enter redis command-line interface, exit forced to exit or close the connection tool (xshell, etc.) will result in redis process exits
Here Insert Picture Description
need to restart redis After modifying the configuration file

Note: Start redis sure to specify the configuration file, otherwise the configuration file does not take effect

./src/redis-server redis.conf



At this time, if the connection or not, the following method can try

> Selection Example - Ali cloud into the management console -> to enter the cloud server
Here Insert Picture Description
selection manager
Here Insert Picture Description
to select the security group in this instance
Here Insert Picture Description
selection rules configuration
Here Insert Picture Description
option to add the security group rules
Here Insert Picture Description
after selecting add, change only the content of the red box on the line, write the description just
Here Insert Picture Description
after saving it will add to the success of the security rule group
Here Insert Picture Description

Then, the release pagoda Redis port
Here Insert Picture Description
here can Redis a normal connection.

Published 51 original articles · won praise 11 · views 6070

Guess you like

Origin blog.csdn.net/weixin_42140261/article/details/105113098