Hi,
I have been trying to implement Redis cluster and run it successfully, but some way or other I am facing issues with it, which are as follows:
1. I was running ShardedJedis for consistent hashing without using any ShardedJedisPool. I am using a client which has 3-4 for shards.
2. When I tried to run it in production environment I started getting following errors:
redis.clients.jedis.exceptions.JedisConnectionException: It seems like server has closed the connection.
at redis.clients.util.RedisInputStream.readLine(RedisInputStream.java:90) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Protocol.processError(Protocol.java:58) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Protocol.process(Protocol.java:66) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Protocol.read(Protocol.java:131) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:182) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.BinaryJedis.get(BinaryJedis.java:76) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.BinaryShardedJedis.get(BinaryShardedJedis.java:50) ~[jedis-2.1.0.jar:na]
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Broken pipe
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:53) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:33) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Connection.sendCommand(Connection.java:80) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Connection.sendCommand(Connection.java:75) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.Jedis.get(Jedis.java:66) ~[jedis-2.1.0.jar:na]
at redis.clients.jedis.ShardedJedis.get(ShardedJedis.java:43) ~[jedis-2.1.0.jar:na]
3. Then I came to know that Jedis client is not thread safe, I shifted to ShardedJedisPool, but in that case, I am getting following error:
Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
at redis.clients.jedis.Protocol.process(Protocol.java:79)
at redis.clients.jedis.Protocol.read(Protocol.java:131)
at redis.clients.jedis.Connection.getBinaryBulkReply(Connection.java:182)
at redis.clients.jedis.BinaryJedis.get(BinaryJedis.java:76)
at redis.clients.jedis.BinaryShardedJedis.get(BinaryShardedJedis.java:50)
4. I am running Jetty with jedis, the traffic is high. I use to create a ShardedJedisPool on first time and after that each subsequent request use same poll to take and release the resource.
5. I have been running same configuration with memcached and spymemcached as client and never faced any issue. Doesn't Jedis also maintains a queue like spymemcached for incoming request. Please help me here, as I want to use Redis due to the features which provided by it.