kstyrc / embedded-redis

Redis embedded server for Java integration testing
840 stars 368 forks source link

redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'CLUSTER' #79

Open idas0382 opened 7 years ago

idas0382 commented 7 years ago

In application code we set up cluster using JedisCluster and providing ip and port of one of the masters. But in unit test when we set up RedisCluster as cluster = RedisCluster.builder().sentinelCount(0) .serverPorts(group1.asJava).replicationGroup("master1", 1) .build(); the tests are failing with Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR unknown command 'CLUSTER' at redis.clients.jedis.Protocol.processError(Protocol.java:127) at redis.clients.jedis.Protocol.process(Protocol.java:161) at redis.clients.jedis.Protocol.read(Protocol.java:215) at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:340) at redis.clients.jedis.Connection.getRawObjectMultiBulkReply(Connection.java:285) at redis.clients.jedis.Connection.getObjectMultiBulkReply(Connection.java:291) at redis.clients.jedis.Jedis.clusterSlots(Jedis.java:3376) at redis.clients.jedis.JedisClusterInfoCache.discoverClusterNodesAndSlots(JedisClusterInfoCache.java:54) at redis.clients.jedis.JedisClusterConnectionHandler.initializeSlotsCache(JedisClusterConnectionHandler.java:39) at redis.clients.jedis.JedisClusterConnectionHandler.(JedisClusterConnectionHandler.java:17) at redis.clients.jedis.JedisSlotBasedConnectionHandler.(JedisSlotBasedConnectionHandler.java:20) at redis.clients.jedis.BinaryJedisCluster.(BinaryJedisCluster.java:48) at redis.clients.jedis.JedisCluster.(JedisCluster.java:53)

So cluster command is not supported in embedded-redis ? Please let me know how to go abt testing JedisCluster with embedded redis.

aserrallerios commented 7 years ago

It's not supported. You can find a proper explanation and workaround here: https://github.com/kstyrc/embedded-redis/issues/55

adpjay commented 7 years ago

How does Issue #55 fix this issue? I see a lot of command line statements, which seems like it is no longer embedded redis.

thallium205 commented 6 years ago

I also would like to learn more about how #55 resolves this issue.

Mxas commented 6 years ago

any progress on it?

rchargel commented 5 years ago

Still hoping for progress on this issue