使用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>
相关推荐
cooldream20095 小时前
深入理解 Redis 的主从、哨兵与集群架构
数据库·redis·架构·系统架构师
临界点oc7 小时前
Redis从入门到实战——实战篇(下)
数据库·redis·缓存
小杜-coding8 小时前
黑马点评day02(缓存)
java·spring boot·redis·后端·spring·maven·mybatis
在肯德基吃麻辣烫8 小时前
【Redis】List类型
数据库·redis·list
hylreg11 小时前
xml 和 yaml 的区别
xml·javascript·webpack
源来是大数据的菜鸟12 小时前
如何将腾讯云的测试集成到自己的SpringBoot中
spring boot·redis·腾讯云
Themberfue1 天前
Redis ⑨-Jedis | Spring Redis
java·数据库·redis·sql·spring·缓存
筏.k1 天前
Redis 数据类型详解(一):String 类型全解析
数据库·redis·缓存
阿四啊1 天前
【Redis】Java操作Redis之SpringDataRedis
java·redis
magic 2451 天前
Spring 基于 XML 的自动装配:原理与实战详解
xml·java·spring