Spring Data Redis(1.3.2.RELEASE)是否支持jedis的JedisSentinelPool?

时间:2014-08-05 04:21:50

标签: java spring redis sentinel spring-data-redis

Spring Data Redis(1.3.2.RELEASE)是否支持jedis的JedisSentinelPool?

也许它不支持,谁会给我一个答案?

如果它不支持,我该怎么办?

1 个答案:

答案 0 :(得分:5)

Spring Data Redis 1.4中添加了对Redis Sentinel的支持。它将在即将到来的Evans RC1中,允许配置JedisConnectionFactory以使用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();

您已经可以查看当前的快照构建:

compile(group: 'org.springframework.data', name: 'spring-data-redis', version: '1.4.0.BUILD-SNAPSHOT')