About the bind parameter in the Redis configuration file

Source: Internet
Author: User
Tags bind redis

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.