xml配制reids"/>
使用xml配制reids
如下:
<bean id="connectionFactory"class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"> --><constructor-arg name="clusterConfig"ref="clusterConfig" /><constructor-arg name="poolConfig"ref="jedisPoolConfig" /><property name="password" value="MTIzNDU2"></property></bean><!-- 集群配置 --><bean id="clusterConfig"class="org.springframework.data.redis.connection.RedisClusterConfiguration"><property name="maxRedirects" value="3"></property><!-- 集群服务IP与端口 --><property name="clusterNodes"><set><!-- server1 --><beanclass="org.springframework.data.redis.connection.RedisNode"><constructor-arg name="host" value="127.0.0.1" /><constructor-arg name="port" value="6379" /></bean><!-- server2 --><beanclass="org.springframework.data.redis.connection.RedisNode"><constructor-arg name="host" value="127.0.0.1" /><constructor-arg name="port" value="6380" /></bean><!-- server3 --><beanclass="org.springframework.data.redis.connection.RedisNode"><constructor-arg name="host" value="127.0.0.1" /><constructor-arg name="port" value="6381" /></bean></set></property></bean>
更多推荐
使用xml配制reids
发布评论