sohutv / cachecloud

搜狐视频(sohu tv)Redis私有云平台 :支持Redis多种架构(Standalone、Sentinel、Cluster)高效管理、有效降低大规模redis运维成本,提升资源管控能力和利用率。平台提供快速搭建/迁移,运维管理,弹性伸缩,统计监控,客户端整合接入等功能。(CacheCloud is a Redis cloud management platform. It supports Standalone, Sentinel, and Cluster architectures for Redis, effectively reducing large-scale Redis operation and maintenance costs, and improving resource management and utilization. The platform provides rapid construction/migration, operation and maintenance management, elastic scaling, statistical monitoring, client integration and access and other functions)
http://cachecloud.github.io/
Apache License 2.0
8.76k stars 2.04k forks source link

ERR Client sent AUTH, but no password is set #328

Open LonelyBean opened 6 months ago

LonelyBean commented 6 months ago

redis版本6.2.14 申请集群的时候出现问题。

githubname1024 commented 6 months ago

请提供部署任务的详细日志信息,以便分析。

zergduan commented 4 months ago

这是因为redis 的 protected-mode参数行为在高版本redis中变化导致的。

低版本redis时,protected-mode=yes是否生效决定于bind;但是高版本redis中,protected-mode=yes和bind无关。

cachecloud 在创建带密码的redis实例时,大概按照以下步骤完成:

  1. SSH到目标机器,创建redis配置文件(不带密码,即没有requirepass参数等)
  2. SSH到目标机器,使用上一步创建的配置文件启动redis实例
  3. 在cachecloud服务器上使用jedis远程连接上一步启动的redis实例
  4. 登陆实例后,使用config set 和config rewrite命令为实例设置default的密码

以上步骤,在低版本Redis中是没问题的,但是在高版本redis中就会出现问题,主要错误在第三步:在cachecloud服务器上使用jedis远程连接上一步启动的redis实例

因为第二步创建的redis实例,如果此时protected-mode的值为yes,第三步就会报错:无法连接redis实例,导致无法为redis实例设置密码。

然后后面的步骤中,会试图使用密码登陆redis实例,就会出现报错:c.sohu.cache.redis.impl.RedisCenterImpl : ERR AUTH called without any password configured for the default user. Are you sure your configuration is correct?

所以目前Cachecloud(3.2)是无法正常支持高本本Redis的创建的(例如Redis 7.0 , 7.2 或者 6.2的高版本)

但是也有临时方案,就是创建app时,因为无法登陆redis实例导致过程中断后,手动登陆实例config set protected-mode=no,然后重新执行被中断的创建过程,就可以完成正常创建了。

建议开发人员,修正这个问题,可以在创建conf文件时强制将protected-mode改为no,并在第四步添加密码时再将proteceted-mode改为yes。

githubname1024 commented 3 months ago

首先说明一下: CacheCloud是完全支持高版本Redis(6.2/7.0)部署的。 配置项 bind 0.0.0.0

7.2版本更改了protected-mode 机制,需要调整protected-mode 默认为no,部署完成后,再调整成protected-mode yes。

@zergduan 请提供一下部署网络环境的场景案例,以便在CacheCloud中兼容。