首页 > 代码库 > redis 集群
redis 集群
集群环境搭建:
http://www.cnblogs.com/hjwublog/p/5681700.html
http://lib.csdn.net/article/16/45369?knId=407
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> <!--引入配置属性文件 --> <context:property-placeholder location="classpath:redis.properties" /> <!--<bean id="redisClusterConfiguration" class="com.laowang.util.RedisClusterConfigurationFactoryBean">--> <!--<property name="nodes" value=http://www.mamicode.com/"${redis.nodes}"/>--> <!--<property name="maxRedirects" value=http://www.mamicode.com/"${redis.maxRedirects}"/>--> <!--</bean>--> <bean id="redisNode1" class="org.springframework.data.redis.connection.RedisNode"> <constructor-arg index="0" value=http://www.mamicode.com/"192.168.163.128"/> <constructor-arg index="1" value=http://www.mamicode.com/"7031"/> </bean> <!--<bean id="redisNode2" class="org.springframework.data.redis.connection.RedisNode">--> <!--<constructor-arg index="0" value=http://www.mamicode.com/"192.168.163.128"/>--> <!--<constructor-arg index="1" value=http://www.mamicode.com/"7032"/>--> <!--</bean>--> <bean id="redisClusterConfiguration" class="org.springframework.data.redis.connection.RedisClusterConfiguration"> <property name="clusterNodes"> <set> <ref bean="redisNode1"/> <!--<ref bean="redisNode2"/>--> </set> </property> <property name="maxRedirects" value=http://www.mamicode.com/"30"/> </bean> <bean id="jedisConnectionFactory" class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory" p:usePool="true"> <constructor-arg ref="redisClusterConfiguration"/> </bean> <bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate" p:connectionFactory-ref="jedisConnectionFactory"/> </beans>
redis 集群
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。