我们使用的是 Redisson 3.17.0 和 redis 版本 6.0.8。我们的 Redis 集群模式设置有 3 个主节点,每个主节点有大约 4-5 个副本。当redis master发生故障转移时,redisson开始抛出无法将命令写入连接的异常。即使故障转移完成后(大约 30 秒),异常也不会停止。只有运行 redisson 的实例的反弹才能解决此错误。这影响了我们服务的高可用性。我们将 pingConnectionInterval 设置为 5000 毫秒。我们的阅读模式仅限于大师。
org.redisson.client.RedisTimeoutException: Command still hasn't been written into connection! Try to increase nettyThreads setting. Payload size in bytes: 81. Node source: NodeSource [slot=10354, addr=null, redisClient=null, redirect=null, entry=null], connection: RedisConnection@1578264320 [redisClient=[addr=rediss://-:6379], channel=[id: 0xb0f98c8c, L:/-:55678 - R:-/-:6379], currentCommand=null, usage=1], command: (EVAL), params: [local value = redis.call('hget', KEYS[1], ARGV[2]); after 2 retry attempts
Run Code Online (Sandbox Code Playgroud)
以下是我们的 redisson 客户端配置:
redisClientConfig: {
endPoint: "rediss://$HOST_IP:6379"
scanInterval: 1000 …Run Code Online (Sandbox Code Playgroud) redisson ×1