问题
Does Spring Data Redis (1.3.2.RELEASE) support JedisSentinelPool of jedis?
Maybe it doesn't support,who will give me an answer?
If it doesn't support,how should I do?
回答1:
Support for Redis Sentinel is added to Spring Data Redis 1.4. It will be in the upcoming Evans RC1, allowing configuration of JedisConnectionFactory
to make use of JedisSentinelPool
.
RedisSentinelConfiguration sentinelConfig = new RedisSentinelConfiguration()
.master("mymaster")
.sentinel("127.0.0.1", 26379)
.sentinel("127.0.0.1", 26380);
JedisConnectionFactory factory = new JedisConnectionFactory(sentinelConfig);
factory.afterPropertiesSet();
You can already have a look at the current snapshot build:
compile(group: 'org.springframework.data', name: 'spring-data-redis', version: '1.4.0.BUILD-SNAPSHOT')
来源:https://stackoverflow.com/questions/25131166/does-spring-data-redis-1-3-2-release-support-jedissentinelpool-of-jedis