Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream. #1782

Closed
jagadeesh583 opened this issue Mar 7, 2018 · 2 comments
Labels

Comments

@jagadeesh583
Copy link

Hi i am also facing the same issue.
here is the exception.
[Start of Exception
SEVERE: Lost connection to Sentinel at sentinal server node: portno. Sleeping 5000ms and retrying.
redis.clients.jedis.exceptions.JedisConnectionException: Unexpected end of stream.
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:199)
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
at redis.clients.jedis.Protocol.process(Protocol.java:151)
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.JedisPubSub.process(JedisPubSub.java:121)
at redis.clients.jedis.JedisPubSub.proceed(JedisPubSub.java:115)
at redis.clients.jedis.Jedis.subscribe(Jedis.java:2680)
at redis.clients.jedis.JedisSentinelPool$MasterListener.run(JedisSentinelPool.java:291)
End of exception ]

We have three server nodes one is master, slave, and another one is sentinel server node.

i am trying with following code

`@Value("${redis.sentinel.master}")
private String master;

@value("${redis.sentinel.host}")
private String host;

@value("${redis.sentinel.port}")
private String port;

@value("${redis.sentinel.password}")
private String password;

@value("${redis.sentinel.poolSize}")
private String poolSize;

@bean
public JedisConnectionFactory jedisConnectionFactory() {
JedisConnectionFactory jedisConnectionFactory = new JedisConnectionFactory(this.redisSentinelConfiguration(),
this.jedisPoolConfig());
jedisConnectionFactory.setPassword(password);
return jedisConnectionFactory;
}

@bean
public RedisSentinelConfiguration redisSentinelConfiguration() {
Set hostAndPorts = new HashSet();
hostAndPorts.add(host + ":" + port);
RedisSentinelConfiguration redisSentinelConfiguration = new RedisSentinelConfiguration(master, hostAndPorts);
return redisSentinelConfiguration;
}

@bean
public JedisPoolConfig jedisPoolConfig() {
JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
jedisPoolConfig.setMaxTotal(Integer.parseInt(poolSize));
jedisPoolConfig.setMaxIdle(15);
jedisPoolConfig.setMinIdle(1);
jedisPoolConfig.setMaxWaitMillis(10000);
jedisPoolConfig.setTestOnBorrow(true);
return jedisPoolConfig;
}
`
here is my redis server version and maven dependencies

Redis server v=3.0.3 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=dd7754250dca4ea7
and
org.springframework.data spring-data-redis 1.5.0.RELEASE redis.clients jedis 2.9.0 org.springframework.session spring-session-data-redis 1.3.1.RELEASE

It seems there is no problem with the timeouts and if you want the configuration files for the master, slave and sentinel nodes. I will update here.

Thanks.

@jagadeesh583
Copy link
Author

jagadeesh583 commented Mar 7, 2018

Please refer the last comments in #932 and #1029.

Copy link

This issue is marked stale. It will be closed in 30 days if it is not updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant