Redis 小记 - 保护模式问题

今天部署新项目,俩台机器公用一个redis 实例,其中一台机器有问题,用客户端工具可以访问到,但是用keys * 就报错了:

-DENIED Redis is running in protected modebecause protected mode is enabled, no bind address was specified, noauthentication password is requested to clients.   
In this mode connections areonly accepted from the loopback interface. If you want to connect from externalcomputers to Redis you may adopt one of the following......

百度了一下,是需要

1.bind 127.0.0.1 这一行.

2.protected-mode yes   将这行改为no。

然后重启redis。 如果还报类似的错误。很大可能是因为改的配置文件没有生效。这时候可以换个启动方式试试。

比如 redis-cli.exe redis.windows.conf  指定配置文件方式来启动。启动后,连接实例,keys * 查看下。应该就行了。

猜你喜欢

转载自blog.csdn.net/qq_20714801/article/details/92767822