25,980
社区成员
发帖
与我相关
我的任务
分享
JAR包:
spring-data-redis-1.7.1.release
commons-pool2-2.3
redis.clients-2.8
org.springframework spring -xx , 4.1.7
<bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig"/>
<bean id="redisNode7001" class="org.springframework.data.redis.connection.RedisNode">
<constructor-arg name="host" value="10.199.192.151" />
<constructor-arg name="port" value="7001" />
</bean>
<bean id="redisNode7002" class="org.springframework.data.redis.connection.RedisNode">
<constructor-arg name="host" value="10.199.192.151" />
<constructor-arg name="port" value="7002" />
</bean>
<bean id="redisNode7003" class="org.springframework.data.redis.connection.RedisNode">
<constructor-arg name="host" value="10.199.192.151" />
<constructor-arg name="port" value="7003" />
</bean>
<bean id="redisNode7004" class="org.springframework.data.redis.connection.RedisNode">
<constructor-arg name="host" value="10.199.192.151" />
<constructor-arg name="port" value="7004" />
</bean>
<bean id="redisNode7005" class="org.springframework.data.redis.connection.RedisNode">
<constructor-arg name="host" value="10.199.192.151" />
<constructor-arg name="port" value="7005" />
</bean>
<bean id="redisNode7006" class="org.springframework.data.redis.connection.RedisNode">
<constructor-arg name="host" value="10.199.192.151" />
<constructor-arg name="port" value="7006" />
</bean>
<bean id="redisClusterConfiguration" class="org.springframework.data.redis.connection.RedisClusterConfiguration">
<property name="clusterNodes">
<set>
<ref bean="redisNode7001"/>
<ref bean="redisNode7002"/>
<ref bean="redisNode7003"/>
<ref bean="redisNode7004"/>
<ref bean="redisNode7005"/>
<ref bean="redisNode7006"/>
</set>
</property>
</bean>
<bean id="jedisFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory">
<constructor-arg index="0" ref="redisClusterConfiguration"/>
<constructor-arg index="1" ref="jedisPoolConfig"/>
</bean>
<bean id="jedisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="jedisFactory" />
<property name="keySerializer">
<bean
class="org.springframework.data.redis.serializer.StringRedisSerializer" />
</property>
</bean>