Connection to remote redis server is reset

995 views
Skip to first unread message

Arafat Al Mahmud

unread,
May 26, 2015, 2:55:02 AM5/26/15
to redi...@googlegroups.com

Trying the basic set operation on a redis server installed in red hat linux.

        JedisPool pool = new JedisPool(new JedisPoolConfig(), HOST, PORT);

        Jedis jedis = null;
        try {
          jedis = pool.getResource();

          System.out.println(jedis.isConnected()); //prints true

          jedis.set("status", "online"); //gets exception

        } finally {
          if (jedis != null) {
            jedis.close();
          }
        }

        pool.destroy();

Getting the following exception:

Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Connection reset
    at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:201)
    at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
    at redis.clients.jedis.Protocol.process(Protocol.java:132)
    at redis.clients.jedis.Protocol.read(Protocol.java:196)
    at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:288)
    at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:187)
    at redis.clients.jedis.Jedis.set(Jedis.java:66)
    at com.revechat.spring.redis_test.App.main(App.java:28)
Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:195)
    ... 7 more

Jonathan Leibiusky

unread,
May 26, 2015, 8:05:06 AM5/26/15
to redi...@googlegroups.com

It seems like the server is coding the connection.  Maybe a firewall? Are you able to telnet redis?


--
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/d/optout.

Greg Andrews

unread,
May 26, 2015, 5:03:27 PM5/26/15
to redi...@googlegroups.com
How much time elapses before the connection is broken?  Is any traffic (commands and replies) passing through the connection when it's broken, or is the connection idle?

Is your Redis server process configured to keep logfiles?  What does the Redis log say about the connection at the time Jedis says the connection breaks?

  -Greg


--
Reply all
Reply to author
Forward
0 new messages