jedis icon indicating copy to clipboard operation
jedis copied to clipboard

How can I solve the problem of reconnection

Open xingzhuipingye opened this issue 2 years ago • 2 comments

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

xingzhuipingye avatar Apr 06 '22 11:04 xingzhuipingye

Could you use Jedis version 4.2.x? There is a change there which may be helpful for you.

sazzad16 avatar Apr 06 '22 12:04 sazzad16

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?

xingzhuipingye avatar Apr 07 '22 05:04 xingzhuipingye

This issue is marked stale. It will be closed in 30 days if it is not updated.

github-actions[bot] avatar Jan 03 '24 00:01 github-actions[bot]