深度理解redis.conf文件

port 6379

Accept connections on the specified port, default is 6379 , If port 0 is specified Redis will not listen on a TCP socket.

接收一个指定端口上的链接,默认6379端口,如果指定端口号0,redis则不会监听TCP socket。

protected-mode yes

Protected mode is a layer of security protection, in order to avoid that Redis instances left open on the internet are accessed and exploited.
When protected mode is on and if: 1) The server is not binding explicitly to a set of addresses using the "bind" directive. 2) No password is configured.
The server only accepts connections from clients connecting from the IPv4 and IPv6 loopback addresses 127.0.0.1 and ::1, and from Unix domain
By default protected mode is enabled. You should disable it only if you are sure you want clients from other hosts to connect to Redis even if no authentication is configured, nor a specific set of interfaces are explicitly listed using the "bind" directive.

保护模块是一层安全保护模式,是为了避免在互联网上打开保持开启状态的redis实例,被访问和利用。
当保护模式打开时,如果,服务器没有显示绑定一组指定的地址和没有密码配置。
那么服务器只能接收IPv4和IPv6环回地址127.0.0.1和:: 1以及Unix域的客户端链接。
默认启动保护模式,你可以关闭它,只有你确定希望其他主机客户端的链接redis,即使没有配置身份认证,也不应使用“bind”指令明确列出一组特定的接口。

猜你喜欢

转载自www.cnblogs.com/feiqiangsheng/p/10889278.html