看起来像保护模式是redis 3.2中的一项新的安全功能。短版本是如果你没有明确地绑定到一个IP地址,它将只允许访问本地主机。
如果您只希望在单个主机上创建群集,则可能是好的。如果您使用多台主机创建集群,则需要关闭保护模式或显式绑定到一个IP地址。
从redis.conf文件:
# 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
# sockets.
#
# 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.
protected-mode yes
有关于如何纠正这个,如果你试图使用的东西除了回环接口连接到它的指令:
DENIED Redis的运行在保护模式下,因为启用了保护模式,没有指定绑定地址,所以不向客户端请求认证密码。在这种模式下,连接只能从回送接口接受。如果要从外部计算机连接到Redis,您可以采用以下解决方案之一:1)只需禁用保护模式,即可通过从同一主机连接到Redis,从回送接口发送命令'CONFIG SET protected-mode no'正在运行,但如果你这样做,MAKE SURE Redis不能从互联网公开访问。使用CONFIG REWRITE使此更改永久生效。 2)或者,您可以通过编辑Redis配置文件并将保护模式选项设置为'no'来禁用保护模式,然后重新启动服务器。 3)如果您只是为了测试而手动启动服务器,请使用' - 保护模式否'选项重启它。 4)设置绑定地址或认证密码。注意:您只需执行上述任一操作即可让服务器开始接受来自外部的连接。
redis-trib.rb的输出非常简洁(可能适当)。