我们使用的是 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
masterConnectionPoolSize: 64
masterConnectionMinimumIdleSize: 24
sslEnableEndpointIdentification: false
idleConnectionTimeout: 30000
connectTimeout: 10000
timeout: 3000
retryAttempts: 2
retryInterval: 300
pingConnectionInterval: 5000
keepAlive: true
tcpNoDelay: true
dnsMonitoringInterval: 5000
threads: 16
nettyThreads: 32
}
Run Code Online (Sandbox Code Playgroud)
redisson 如何在不重新启动应用程序的情况下从这些异常中恢复?我们尝试增加 netty 线程等,但 redisson 无法从故障转移中恢复
| 归档时间: |
|
| 查看次数: |
1278 次 |
| 最近记录: |