Closed liuqian1990 closed 2 years ago
@liuqian1990 Please provide some more info. THKS.
fork最新版的,redis也设置了相关密码,试了 redis 4.0.14也是不行
@liuqian1990 Please check the target instance config under the dir "/cachecloud/conf/" and whether the requirepass is exists and is same with original instance.
密码都一样,用无数据的slot迁移没问题,有数据的就报错
将目标端密码置为空就可以了
收到,多谢反馈。这种情况从代码设计运行来看,属于不正常现象。您的场景可能有些设置我没有完全了解,我这边没有重现您的问题。如后续有问题,欢迎提出。
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需要传入密码
@liuqian1990 经过在4.0.14上测试,重现了您的问题,多谢指出,将于近期修复该bug。
Bug fix has alreadly merge to main. Close this issue.
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)