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.86k stars 2.04k forks source link

ERR Target instance replied with error: NOAUTH Authentication required. #284

Closed liuqian1990 closed 2 years ago

liuqian1990 commented 2 years ago

1、Redis 版本 6.2.7 2、Redis 做水平扩容,迁移slot时报下面错误

2022-06-30 09:29:41.768 WARN 33674 --- [nio-8080-exec-4] c.s.c.s.app.impl.AppDeployCenterImpl : retry reshard appId=6 instance=192.168.1.133:26386 deploy done 2022-06-30 09:29:41.775 INFO 33674 --- [eshard-thread-9] c.sohu.cache.redis.RedisClusterReshard : slot=2731,clusterSetSlotImporting=OK 2022-06-30 09:29:41.776 INFO 33674 --- [eshard-thread-9] c.sohu.cache.redis.RedisClusterReshard : slot=2731,clusterSetSlotMigrating=OK 2022-06-30 09:29:41.776 ERROR 33674 --- [eshard-thread-9] c.s.cache.redis.RedisClusterReshard$4 : ERR Target instance replied with error: NOAUTH Authentication required.

redis.clients.jedis.exceptions.JedisDataException: ERR Target instance replied with error: NOAUTH Authentication required. at redis.clients.jedis.Protocol.processError(Protocol.java:139) at redis.clients.jedis.Protocol.process(Protocol.java:173) at redis.clients.jedis.Protocol.read(Protocol.java:227) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:352) at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:270) at redis.clients.jedis.Jedis.migrate(Jedis.java:3758) at com.sohu.cache.redis.RedisClusterReshard$4.execute(RedisClusterReshard.java:302) at com.sohu.cache.util.IdempotentConfirmer.run(IdempotentConfirmer.java:27) at com.sohu.cache.redis.RedisClusterReshard.moveSlotData(RedisClusterReshard.java:306) at com.sohu.cache.redis.RedisClusterReshard.migrateSlotData(RedisClusterReshard.java:392) at com.sohu.cache.redis.RedisClusterReshard.migrateSlot(RedisClusterReshard.java:247) at com.sohu.cache.stats.app.impl.AppDeployCenterImpl$1.run(AppDeployCenterImpl.java:732) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

2022-06-30 09:29:41.777 ERROR 33674 --- [eshard-thread-9] c.s.cache.redis.RedisClusterReshard$4 : ERR Target instance replied with error: NOAUTH Authentication required.

redis.clients.jedis.exceptions.JedisDataException: ERR Target instance replied with error: NOAUTH Authentication required. at redis.clients.jedis.Protocol.processError(Protocol.java:139) at redis.clients.jedis.Protocol.process(Protocol.java:173) at redis.clients.jedis.Protocol.read(Protocol.java:227) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:352) at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:270) at redis.clients.jedis.Jedis.migrate(Jedis.java:3758) at com.sohu.cache.redis.RedisClusterReshard$4.execute(RedisClusterReshard.java:302) at com.sohu.cache.util.IdempotentConfirmer.run(IdempotentConfirmer.java:27) at com.sohu.cache.redis.RedisClusterReshard.moveSlotData(RedisClusterReshard.java:306) at com.sohu.cache.redis.RedisClusterReshard.migrateSlotData(RedisClusterReshard.java:392) at com.sohu.cache.redis.RedisClusterReshard.migrateSlot(RedisClusterReshard.java:247) at com.sohu.cache.stats.app.impl.AppDeployCenterImpl$1.run(AppDeployCenterImpl.java:732) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

2022-06-30 09:29:41.777 ERROR 33674 --- [eshard-thread-9] c.s.cache.redis.RedisClusterReshard$4 : ERR Target instance replied with error: NOAUTH Authentication required.

redis.clients.jedis.exceptions.JedisDataException: ERR Target instance replied with error: NOAUTH Authentication required. at redis.clients.jedis.Protocol.processError(Protocol.java:139) at redis.clients.jedis.Protocol.process(Protocol.java:173) at redis.clients.jedis.Protocol.read(Protocol.java:227) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:352) at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:270) at redis.clients.jedis.Jedis.migrate(Jedis.java:3758) at com.sohu.cache.redis.RedisClusterReshard$4.execute(RedisClusterReshard.java:302) at com.sohu.cache.util.IdempotentConfirmer.run(IdempotentConfirmer.java:27) at com.sohu.cache.redis.RedisClusterReshard.moveSlotData(RedisClusterReshard.java:306) at com.sohu.cache.redis.RedisClusterReshard.migrateSlotData(RedisClusterReshard.java:392) at com.sohu.cache.redis.RedisClusterReshard.migrateSlot(RedisClusterReshard.java:247) at com.sohu.cache.stats.app.impl.AppDeployCenterImpl$1.run(AppDeployCenterImpl.java:732) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

2022-06-30 09:29:41.777 ERROR 33674 --- [eshard-thread-9] c.sohu.cache.redis.RedisClusterReshard : migrate key=AppLog:Filebeat:Container:1267981:hsperfdata_ops failed 192.168.1.133:6460 slot=2731

java.lang.RuntimeException: migrate key=AppLog:Filebeat:Container:1267981:hsperfdata_ops failed 192.168.1.133:6460 slot=2731 at com.sohu.cache.redis.RedisClusterReshard.moveSlotData(RedisClusterReshard.java:308) at com.sohu.cache.redis.RedisClusterReshard.migrateSlotData(RedisClusterReshard.java:392) at com.sohu.cache.redis.RedisClusterReshard.migrateSlot(RedisClusterReshard.java:247) at com.sohu.cache.stats.app.impl.AppDeployCenterImpl$1.run(AppDeployCenterImpl.java:732) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

2022-06-30 09:29:41.777 ERROR 33674 --- [eshard-thread-9] c.sohu.cache.redis.RedisClusterReshard : source=192.168.1.133:6460 target=192.168.1.133:26386 slot=2731 num=0 reShard failed

java.lang.RuntimeException: source=192.168.1.133:6460 target=192.168.1.133:26386 slot=2731 num=0 reShard failed at com.sohu.cache.redis.RedisClusterReshard.migrateSlotData(RedisClusterReshard.java:401) at com.sohu.cache.redis.RedisClusterReshard.migrateSlot(RedisClusterReshard.java:247) at com.sohu.cache.stats.app.impl.AppDeployCenterImpl$1.run(AppDeployCenterImpl.java:732) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

githubname1024 commented 2 years ago

@liuqian1990 Please provide some more info. THKS.

  1. the version of cachecloud you used
  2. whether the original redis instance config password.
liuqian1990 commented 2 years ago

fork最新版的,redis也设置了相关密码,试了 redis 4.0.14也是不行

githubname1024 commented 2 years ago

@liuqian1990 Please check the target instance config under the dir "/cachecloud/conf/" and whether the requirepass is exists and is same with original instance.

liuqian1990 commented 2 years ago

密码都一样,用无数据的slot迁移没问题,有数据的就报错

liuqian1990 commented 2 years ago

将目标端密码置为空就可以了

githubname1024 commented 2 years ago

收到,多谢反馈。这种情况从代码设计运行来看,属于不正常现象。您的场景可能有些设置我没有完全了解,我这边没有重现您的问题。如后续有问题,欢迎提出。

liuqian1990 commented 2 years ago

cachecloud-web/src/main/java/com/sohu/cache/redis/RedisClusterReshard.java 302行 String response = source.migrate(target.getClient().getHost(), target.getClient().getPort(), key, 0, migrateTimeout * (migrateTimeOutFactor++)); 修改为这种用法解决问题 String response = source.migrate(target.getClient().getHost(), target.getClient().getPort(),0, migrateTimeout * (migrateTimeOutFactor++), MigrateParams.migrateParams().auth(AuthUtil.getAppIdMD5(String.valueOf(appId))), key); 原因migrate需要传入密码

githubname1024 commented 2 years ago

@liuqian1990 经过在4.0.14上测试,重现了您的问题,多谢指出,将于近期修复该bug。

githubname1024 commented 2 years ago

Bug fix has alreadly merge to main. Close this issue.