Closed zil closed 6 years ago
@mp911de Can you offer your opinion on this one please? It looks like Spring Data Redis allows a JedisConnectionFactory to be created with client configuration that means that the accompanying sentinel configuration is ignored. Is that intentional?
There are two things to this issue which is a regression bug:
JedisClientConfiguration
. JedisClientConfiguration
requires explicit pooling activation, which plays into the cause.JedisClientConfiguration
, we lost the default in Spring Boot that applied pooling even when spring.redis.jedis.pool
properties were not set.I filed DATAREDIS-765 to address the issue on our side. We should prevent falling back to localhost connections.
Thanks, Mark. I'm watching DATAREDIS-765 now. If you go with the "configure the pool with defaults" option, it sounds like a change in Boot won't be necessary. I'll keep this one open until that decision's been made.
It looks like this has been fixed entirely on the Data Redis side of things. We'll pick this up in the next Spring Data Kay service release. @mp911de do you have any plans for SR4 at the moment?
Nothing scheduled yet. Releasing Kay SR4 would make sense right before Spring Boot RC2.
The issue is fixed in Spring Data Redis entirely.
https://github.com/spring-projects/spring-boot/blob/d478e9bf57b73ca84539c0e9bfa82961256e50d9/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.java#L88
https://github.com/spring-projects/spring-data-redis/blob/2fe048bfff856012f42aed9f702334bc5b7d28fd/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java#L275
Using springBoot with version
2.0.0.M6
andredis.clients:jedis:2.9.0
,with config:But Spring Boot not use sentinel config,but resolve to
localhost:6379
.By debugging I found the above code is the cause: If the pool configuration is leave out,Spring Boot will resolve tolocalhost:6379