Failing to re-connect to redis cluster deployed as a k8s service when rediscluster service is restarted #2362
-
I have a redis cluster with 6 nodes (3 masters and 3 slaves) deployed as k8s service. Consuming application uses Lettuce as a redis client and can connect to redis successfully. But when the redis service is redeployed or any node is restarted from the cluster, Lettuce is failing with "Unable to connect" exception. Error- Cannot reconnect to [172.16.32.178/:6379]: Connection reset\njava.net.SocketException: Connection reset\n\tat I am checking _connection.isOpen() flag to check the connection's liveness. Actually when redis cluster service restarts by any reason, its ip address changes but Lettuce still tries to connect to the old ip. I am looking for any Lettuce's API with which we can reset its connection memory when the redis cluster service is redeployed/restarted and existing connection is not valid ( isOpen() = false). Requesting help on this . |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you configure a custom |
Beta Was this translation helpful? Give feedback.
-
This code worked.
|
Beta Was this translation helpful? Give feedback.
This code worked.