今天测试了一下在本机(win10系统)远程连接 centos下的redis,结果报了以下错误:
-DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect
翻译附上
-DENIED Redis运行在保护模式下,因为启用了保护模式,没有指定绑定地址,没有向客户端请求认证密码。在这种模式下,只接受来自环回接口的连接。如果你想要联系
1 修改redis.conf配置文件,将绑定的ip地址端口号给注释掉。
(redis默认绑定本机地址,所以其他IP连接不上,将这一行注释掉:# bind 127.0.0.1)
2.Linux上的redis默认处于安全保护模式,因此我们无法建立连接,提供了两种解决方法,
2.1 一在redis.conf中设置保护模式为no(protected-mode no
2.2 redis默认是不需要密码的,可以直接登录,在这里我们加上安全认证,即加上连接密码(requirepass "my_keyword"
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface UpdateCache {
/** 指定要刷新的key,可以进行模糊匹配 */
String key() default "";
}