-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Failed to establish connection to redis cluster mode deployment #3613
Copy link
Copy link
Closed
Labels
could not reproducestalewaiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continue
Description
Expected behavior
Jedis java client should connect with Redis cluster deployment.
Actual behavior
Jedis java client failed to connect with Redis cluster deployment.
Steps to reproduce:
- Install redis cluster deployment in kubernetes cluster (
helm install redis oci://registry-1.docker.io/bitnamicharts/redis-cluster -n redis) - Portforward 6379 to local (
kubectl port-forward svc/redis-redis-cluster 6379 -n redis) - Execute Jedis java client
Redis / Jedis Configuration
Jedis version: 4.4.3
Redis version:
Chart version: redis-cluster-9.1.3
App Version: 7.2.3
Java version:
java --version
openjdk 11.0.20 2023-07-18
OpenJDK Runtime Environment Temurin-11.0.20+8 (build 11.0.20+8)
OpenJDK 64-Bit Server VM Temurin-11.0.20+8 (build 11.0.20+8, mixed mode)
Java Jedis code snippet
try {
var redisHostName = "127.0.0.1"
var redisPort = 6379;
var redisUserName = "default";
var redisPassword = "HhKh5HriPG";
Set<HostAndPort> nodes = new HashSet<>();
nodes.add(new HostAndPort(redisHostName, redisPort));
cluster = new JedisCluster(nodes, redisUserName, redisPassword);
cluster.set("testkey", "testvalue");
System.out.println(cluster.get("testkey"));
} catch(Exception e) {
e.printStackTrace();
}
Exception
redis.clients.jedis.exceptions.JedisClusterOperationException: Cluster retry deadline exceeded.
at redis.clients.jedis.executors.ClusterCommandExecutor.executeCommand(ClusterCommandExecutor.java:125)
at redis.clients.jedis.UnifiedJedis.executeCommand(UnifiedJedis.java:183)
at redis.clients.jedis.UnifiedJedis.set(UnifiedJedis.java:651)
at com.ashok.redis.RedisClusterCacheClient.initRedisClusterConnection(RedisClusterCacheClient.java:43)
at com.ashok.redis.RedisClusterCacheClient.<init>(RedisClusterCacheClient.java:28)
at com.ashok.redis.RedisClusterCacheClient.getInstance(RedisClusterCacheClient.java:54)
at com.ashok.redis.RedisClusterCacheClient.main(RedisClusterCacheClient.java:23)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
could not reproducestalewaiting-for-feedbackWe need additional information before we can continueWe need additional information before we can continue