Redisson indefinitely try to reconnect on old sentinel instance
See original GitHub issueWe using redisson for our tomcat session cache in Kubernetes cluster. We have setup a sentinel cluster with 3 redis instance.
We have some issue when one of our redis pod changes. This can happen when maintaining a node. In this case the redis pod is recreated on another node but with a new IP.
For connect to sentinel we use a statefulset headless service.
Expected behavior
Redisson reconnect to the new redis node and stop communicating with the old pod
Actual behavior
Redisson reconnect to the new redis node BUT continue to try reconnect on old node indefinitely.
Steps to reproduce or test case
- Setup redis sentinel cluster in Kubernetes (with statefulset). Our pod have 2 container, one for redis (port 6379), and one for is sentinel (port 26379).
- Start tomcat pod with redisson config for session.
kubectl delete pod <redis slave pod>
Redis version
6.0.12
Redisson version
3.15.3
Redisson configuration
sentinelServersConfig:
password: ${REDIS_PASSWORD}
subscriptionConnectionMinimumIdleSize: 1
subscriptionConnectionPoolSize: 10
slaveConnectionMinimumIdleSize: 2
slaveConnectionPoolSize: 10
masterConnectionMinimumIdleSize: 5
masterConnectionPoolSize: 10
idleConnectionTimeout: 5000
pingConnectionInterval: 0
dnsMonitoringInterval: 5000
checkSentinelsList: true
clientName: ${HOSTNAME}
sentinelAddresses:
- "redis://redis-${ENV}-rds01-0.redis-${ENV}-rds01-headless.infra.svc.cluster.local:26379"
- "redis://redis-${ENV}-rds01-1.redis-${ENV}-rds01-headless.infra.svc.cluster.local:26379"
- "redis://redis-${ENV}-rds01-2.redis-${ENV}-rds01-headless.infra.svc.cluster.local:26379"
masterName: "redisk8s"
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
How do sentinel round reconnect to when all are down ? #3920
Hello, when redisson work in scheme 1 master and 2 slave with sentinel daemon on each, then 2 slave go down, some time...
Read more >Error: READONLY You can't write against a read only slave ...
If the above error occurs, it means that the current Redis service is read-only and has no write permission.
Read more >High availability with Redis Sentinel
Clients may write indefinitely to both sides, and there is no way to understand when the partition heals what configuration is the right...
Read more >redisson - Bountysource
redisson keeps the redisclient that connects to the old node(192.168.3.47 ), and the connectionWatchDog keeps creating connections in the background to try to...
Read more >Redis (error) NOAUTH Authentication required - Server Fault
NOAUTH requires to authenticate via AUTH method before executing any get/set/etc. call, in predis that can be done via the auth() method, for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I confirm that it is corrected. Thanks 😃
It’s difficult to reproduce the problem. Now, this happens only when the entire redis cluster goes down and returns to normal again. And I collected some TRACE level logs. redisson.log