Note: The content of this article is incorrect, please refer to http://blog.csdn.net/hel12he/article/details/46911159
In configuration file redis.conf, the default bind interface is 127.0.0.1, which is the local loopback address. In this case, access to the Redis service can only be connected through a native client, not through a remote connection,
This avoids exposing the Redis service to a dangerous network environment, preventing some unsafe people from casually passing remote
Connect to the Redis service.
If the BIND option is empty, it will accept all connections from the available network interfaces.
Example:
For example, there are two Redis servers, the IP is: 192.168.1.101 and 192.168.1.103, how to access the Redis on 101 via REDIS-CLI on the 103. Before remote connection 103, let's talk about some key parameters of REDIS-CLI:
Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]] -H < host Ip>, default is 127.0.0.1
-p < port;, default is 6379
-A < Password, if Redis is locked, you need to pass the password
--help, displaying Help information
When accessing Redis on 101 via REDIS-CLI on 103, first modify the redis.conf file on 103 and add a line under bind: Bind 192.168.1.101
This allows the Redis service on 103 to listen connections from 192.168.1.101.
By introducing RENDIS-CLI usage, connecting 103 on 101 should be simple: [plain] view plain cop [root@xsf001 ~]# redis-cli-h 192.168.1.103-p 6379 Redis 192.168.1.103:6379>
Official Document Description:
Protected Mode
Unfortunately many users fail to protect Redis instances from being accessed from external networks. Many instances is simply left exposed on the Internet with public IPs. For this reasons since version 3.2.0, when Redis was executed with the default configuration (binding all the interfaces) a nd without any password in order to access it, it enters a special mode called proteced mode. In this mode Redis is replies to queries from the loopback interfaces, and reply to other clients connecting from other Addresses with a error, explaining what's happening and how to configure Redis properly.