jedis
jedis copied to clipboard
How can I solve the problem of reconnection
Expected behavior
How can I solve the problem of reconnection
Actual behavior
My test environment often prompts "jedisnreachableclusternodeexception: no reachable node in cluster". I think my test environment is often restarted, so does jedis have the function to reconnect to redis cluster? If so, what should I do
Steps to reproduce:
Please create a reproducible case of your problem. Make sure that case repeats consistently and it's not random
Redis / Jedis Configuration
Jedis version: 3.6.0
Redis version:
Java version: 1.8
Could you use Jedis version 4.2.x? There is a change there which may be helpful for you.
Let me talk about the scenario. My computer can't connect to the redis cluster when connected to the wired network, but WiFi can. In the first step, my computer can connect to the wired network, and my application can't get nodes and slots. In the second step, I unplug my network cable and connect to wifi. At this time, my redistemplate still can't access the redis cluster, because jedisclusterinfo cache doesn't contain nodes and slots. What should I do to access randomkey regularly, get exceptions, and then call the discoverclusterslots method again? Is there any other way?
This issue is marked stale. It will be closed in 30 days if it is not updated.