使用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>
相关推荐
ALex_zry14 小时前
Redis Cluster 分布式缓存架构设计与实践
redis·分布式·缓存
乔江seven17 小时前
【Flask 进阶】3 从同步到异步:基于 Redis 任务队列解决 API 高并发与长耗时任务阻塞
redis·python·flask
这周也會开心18 小时前
Redis与MySQL回写中的数据类型存储设计
数据库·redis·mysql
shuair19 小时前
redis缓存预热、缓存击穿、缓存穿透、缓存雪崩
redis·spring·缓存
shuair20 小时前
guava布隆过滤器及cuckoo过滤器
redis·guava
上架ipa20 小时前
redis图形化客户端功能对比
redis·缓存
indexsunny1 天前
互联网大厂Java面试实战:微服务与Spring生态技术解析
java·spring boot·redis·kafka·mybatis·hibernate·microservices
为什么不问问神奇的海螺呢丶1 天前
n9e categraf redis监控配置
前端·redis·bootstrap
笨蛋不要掉眼泪1 天前
RAG知识库核心API架构全解析:从文档加载到向量检索的完整流程
java·spring boot·redis·ai·架构
学到头秃的suhian1 天前
Redis执行
redis