Spring中添加Cluster(核心,JedisClusterFactory创建RedisCluter对象,jedisClusterNodes为构造函数的重要参数)
<bean id="jedisCluster" class="com.css.redis.factory.JedisClusterFactory">
<property name="connectionTimeout" value="3000" />
<property name="soTimeout" value="3000" />
<property name="maxRedirections" value="5" />
<!-- property name="genericObjectPoolConfig" ref="genericObjectPoolConfig" /-->
<property name="jedisClusterNodes">
<set>
<value>192.168.181.1:8001</value>
<value>192.168.181.1:8002</value>
<value>192.168.181.1:8003</value>
<value>192.168.181.1:8004</value>
<value>192.168.181.1:8005</value>
<value>192.168.181.1:8006</value>
</set>
</property>
</bean>
<bean name="redisClusterClient" class="com.css.redis.impl.JedisClusterClient">
<property name="jedisCluster" ref="jedisCluster" />
</bean>
<property name="soTimeout" value="3000" />
<property name="maxRedirections" value="5" />
<!-- property name="genericObjectPoolConfig" ref="genericObjectPoolConfig" /-->
<property name="jedisClusterNodes">
<set>
<value>192.168.181.1:8001</value>
<value>192.168.181.1:8002</value>
<value>192.168.181.1:8003</value>
<value>192.168.181.1:8004</value>
<value>192.168.181.1:8005</value>
<value>192.168.181.1:8006</value>
</set>
</property>
</bean>
<bean name="redisClusterClient" class="com.css.redis.impl.JedisClusterClient">
<property name="jedisCluster" ref="jedisCluster" />
</bean>