Continuous issues for Redis using Jedis as client

559 views
Skip to first unread message

mohit Agrawal

unread,
Jan 31, 2014, 7:07:17 AM1/31/14
to redi...@googlegroups.com
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.


Jonathan Leibiusky

unread,
Jan 31, 2014, 10:04:27 AM1/31/14
to redi...@googlegroups.com

Hi,

I can probably help you, but I will need more information on how exactly you've configured your pool, and  how you handle ShardedJedis instances that you get from the pool.
If you can share some code that reproduces these errors with your redis configurations it would be amazing.

Thanks,

Jonathan

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages