Redis (centOS 7 阿里云) 设置了 protected-mode no,还是同样的错误。
错误提示:
redis.clients.jedis.exceptions.JedisDataException: 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 from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
1).云端已经修改:
protected-mode no
2).云端连接正常:(执行ping,返回 PONG,如下图)
3).本地连接:
testOnBorrow 设置为 false:
redis.pool.testOnBorrow=false
连接测试还是报同样的错误。
经多次搜索,未解决
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢各位,重启可以了,如下:
配置redis后,kill进程,重新启动redis服务,成功连接!
(redis 目录下)
1)ps -ef | grep redis
2)kill -9 进程编号
3)src/redis-server redis.conf