使用xml配制reids

如下:

java 复制代码
<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 -->
				<bean
					class="org.springframework.data.redis.connection.RedisNode">
					<constructor-arg name="host" value="127.0.0.1" />
					<constructor-arg name="port" value="6379" />
				</bean>

				<!-- server2 -->
				<bean
					class="org.springframework.data.redis.connection.RedisNode">
					<constructor-arg name="host" value="127.0.0.1" />
					<constructor-arg name="port" value="6380" />
				</bean>

				<!-- server3 -->
				<bean
					class="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>
相关推荐
m0_748248021 小时前
Redis 简介与安装指南
数据库·redis·缓存
cr7xin8 小时前
缓存三大问题及解决方案
redis·后端·缓存
睡前要喝豆奶粉10 小时前
在.NET Core Web Api中使用redis
redis·c#·.netcore
祈祷苍天赐我java之术13 小时前
如何在Java中整合Redis?
java·开发语言·redis
星梦清河14 小时前
Redis(四):缓存击穿及其解决方案(SpringBoot+mybatis-plus)
spring boot·redis·缓存
傻啦嘿哟14 小时前
用Redis实现爬虫URL去重与队列管理:从原理到实战的极简指南
数据库·redis·爬虫
@爱学习的小趴菜18 小时前
Redis服务器配置
服务器·数据库·redis
Maỿbe20 小时前
Redis的持久化
数据库·redis·缓存
emma羊羊1 天前
【weblogic】XML反序列化漏洞
xml·安全
白露与泡影1 天前
Redis:我是如何与客户端进行通信的
数据库·redis·缓存