question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redisson indefinitely try to reconnect on old sentinel instance

See original GitHub issue

We 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

  1. 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).
  2. Start tomcat pod with redisson config for session.
  3. 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:closed
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ralmncommented, Apr 21, 2021

I confirm that it is corrected. Thanks 😃

0reactions
kingkonghongcommented, Aug 23, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found