redis每秒创建新连接并删除旧连接

7cwmlq89  于 2021-06-09  发布在  Redis
关注(0)|答案(0)|浏览(449)

我们有一个redis集群(在sentinel模式下运行),有3个节点,我们正在使用redisson(版本3.10.7)与redis进行交互。我们面临一个问题,客户机应用程序无法连接到集群。不断地删除旧的连接并创建新的连接。同样的事情每秒钟都在发生。下面是记录器的快照。

12:01:00.832 [redisson-netty-2-6] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@483495011 [redisClient=[addr=redis://10.79.9.163:6379], channel=[id: 0x767f3c87, L:/192.168.7.24:60173 - R:10.79.9.163/10.79.9.163:6379], command=null]
12:01:00.832 [redisson-netty-2-6] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@1510307492 [redisClient=[addr=redis://10.79.9.163:6379], channel=[id: 0xa8c01128, L:/192.168.7.24:60183 - R:10.79.9.163/10.79.9.163:6379], command=null]
12:01:00.832 [redisson-netty-2-6] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@425141862 [redisClient=[addr=redis://10.79.9.164:6379], channel=[id: 0x19afdfb8, L:/192.168.7.24:60199 - R:10.79.9.164/10.79.9.164:6379], command=null]
12:01:00.832 [redisson-netty-2-6] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@457747719 [redisClient=[addr=redis://10.79.9.164:6379], channel=[id: 0xf2431dfb, L:/192.168.7.24:60211 - R:10.79.9.164/10.79.9.164:6379], command=null]
12:01:00.832 [redisson-netty-2-6] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@1595469651 [redisClient=[addr=redis://10.79.9.164:6379], channel=[id: 0x3226faec, L:/192.168.7.24:60204 - R:10.79.9.164/10.79.9.164:6379], command=null]
12:01:00.922 [pool-2-thread-1] DEBUG org.redisson.client.handler.ConnectionWatchdog - reconnecting RedisConnection@541871189 [redisClient=[addr=redis://10.79.9.164:6379], channel=[id: 0x5396b42d, L:/192.168.7.24:59969 ! R:10.79.9.164/10.79.9.164:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@3ecd3a79(failure: java.util.concurrent.CancellationException)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]] to 10.79.9.164/10.79.9.164:6379 
12:01:00.929 [pool-2-thread-1] DEBUG org.redisson.client.handler.ConnectionWatchdog - reconnecting RedisConnection@495642036 [redisClient=[addr=redis://10.79.9.164:6379], channel=[id: 0xfa2f4f52, L:/192.168.7.24:59973 ! R:10.79.9.164/10.79.9.164:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@28c788eb(failure: java.util.concurrent.CancellationException)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]] to 10.79.9.164/10.79.9.164:6379 
12:01:00.931 [pool-2-thread-1] DEBUG org.redisson.client.handler.ConnectionWatchdog - reconnecting RedisConnection@169281839 [redisClient=[addr=redis://10.79.9.164:6379], channel=[id: 0xf365bc68, L:/192.168.7.24:59976 ! R:10.79.9.164/10.79.9.164:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@6bd0d406(failure: java.util.concurrent.CancellationException)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]] to 10.79.9.164/10.79.9.164:6379 
12:01:00.931 [pool-2-thread-1] DEBUG org.redisson.client.handler.ConnectionWatchdog - reconnecting RedisConnection@65640722 [redisClient=[addr=redis://10.79.9.165:6379], channel=[id: 0x03c68dcf, L:/192.168.7.24:59226 ! R:10.79.9.165/10.79.9.165:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@520c88b3(failure: java.util.concurrent.CancellationException)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]] to 10.79.9.165/10.79.9.165:6379 
12:01:00.932 [pool-2-thread-1] DEBUG org.redisson.client.handler.ConnectionWatchdog - reconnecting RedisConnection@1365249560 [redisClient=[addr=redis://10.79.9.165:6379], channel=[id: 0x0722fcc6, L:/192.168.7.24:59262 ! R:10.79.9.165/10.79.9.165:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@50c8b29f(failure: java.util.concurrent.CancellationException)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]] to 10.79.9.165/10.79.9.165:6379 
12:01:01.080 [redisson-netty-2-8] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@1230181180 [redisClient=[addr=redis://10.79.9.163:6379], channel=[id: 0x148352d3, L:/192.168.7.24:60224 - R:10.79.9.163/10.79.9.163:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@19cb007f(incomplete)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]]
12:01:01.082 [redisson-netty-2-5] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@1221343292 [redisClient=[addr=redis://10.79.9.163:6379], channel=[id: 0xc4ff65cd, L:/192.168.7.24:60229 - R:10.79.9.163/10.79.9.163:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@1891a694(incomplete)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]]
12:01:01.082 [redisson-netty-2-7] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@2036916006 [redisClient=[addr=redis://10.79.9.163:6379], channel=[id: 0xff04b8ab, L:/192.168.7.24:60223 - R:10.79.9.163/10.79.9.163:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@1618e7eb(incomplete)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]]
12:01:01.082 [redisson-netty-2-9] DEBUG org.redisson.connection.ClientConnectionsEntry - new connection created: RedisConnection@1460667823 [redisClient=[addr=redis://10.79.9.163:6379], channel=[id: 0xbdc0d69e, L:/192.168.7.24:60222 - R:10.79.9.163/10.79.9.163:6379], command=CommandData [promise=RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@139695d9(incomplete)], command=(PING), params=[], codec=org.redisson.client.codec.StringCodec]]

我们尝试了以下几点来调查这个问题:
重新启动客户端应用程序。
重新启动redis群集节点。
在这些重启之后,同样的问题仍然存在。
我们可以通过在redis的server.conf中将timeout属性从0改为10秒来解决这个问题。将超时恢复为0也不会导致问题再次发生。
还有人面临类似的问题吗?。如果是,我们知道背后的原因吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题