Spring版本:4.3.21.RELEASE
spring-data-redis版本:

<dependency><groupId>org.springframework.data</groupId><artifactId>spring-data-redis</artifactId><version>1.7.2.RELEASE</version>
</dependency>

jedis版本:

<dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId><version>2.9.0</version>
</dependency>

spring-redis.xml:

<context:annotation-config></context:annotation-config>
<context:component-scan base-package="com.p7.demo.redis" /><bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig"><property name="minIdle" value="2" /><property name="maxIdle" value="10" /><property name="maxTotal" value="20" /><property name="maxWaitMillis" value="1000" /><property name="testOnBorrow" value="true" /><property name="minEvictableIdleTimeMillis" value="3000" />
</bean>
<bean id="redisClusterConfig"class="org.springframework.data.redis.connection.RedisClusterConfiguration"><property name="maxRedirects" value="3"></property><property name="clusterNodes"><set><bean class="org.springframework.data.redis.connection.RedisNode"><constructor-arg name="host" value="192.168.1.11"></constructor-arg><constructor-arg name="port" value="6379"></constructor-arg></bean><bean class="org.springframework.data.redis.connection.RedisNode"><constructor-arg name="host" value="192.168.1.11"></constructor-arg><constructor-arg name="port" value="6380"></constructor-arg></bean><bean class="org.springframework.data.redis.connection.RedisNode"><constructor-arg name="host" value="192.168.1.11"></constructor-arg><constructor-arg name="port" value="6381"></constructor-arg></bean></set></property>
</bean><!-- Redis 连接工厂 -->
<bean id="jeidsConnectionFactory"class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"><constructor-arg name="clusterConfig" ref="redisClusterConfig" /><property name="poolConfig" ref="poolConfig" /><property name="usePool" value="true" /><property name="timeout" value="5000" />
</bean><!-- Redis 客户端 @Resourceprivate RedisTemplate redisTemplate;
-->
<bean id="redisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate"><property name="connectionFactory" ref="jeidsConnectionFactory" />
</bean><!--
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"><property name="connectionFactory" ref="jeidsConnectionFactory" />
</bean><bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate"><property name="connectionFactory" ref="jeidsConnectionFactory" /><property name="keySerializer"><beanclass="org.springframework.data.redis.serializer.StringRedisSerializer" /></property><property name="valueSerializer"><beanclass="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer" /></property><property name="hashKeySerializer"><beanclass="org.springframework.data.redis.serializer.StringRedisSerializer" /></property><property name="hashValueSerializer"><beanclass="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer" /></property>
</bean>-->

spring-data-redis整合redis集群配置相关推荐

  1. 基于redis的cas集群配置(转)

    1.cas ticket统一存储 做cas集群首先需要将ticket拿出来,做统一存储,以便每个节点访问到的数据一致.官方提供基于memcached的方案,由于项目需要,需要做计入redis,根据官方 ...

  2. 分布式业务Redis安装与集群配置

    Redis在百度百科里的解释:Redis是一个开源的使用ANSI  C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API,包括C#.Java.PHP等等 ...

  3. Redis主从复制和集群配置系列之四

    非常感谢  http://blog.csdn.net/dc_726/article/details/48552531 Redis技术学习 https://www.itkc8.com 全面剖析Redis ...

  4. redis三:集群配置

    文章目录 redis集群配置 主从复制 哨兵模式 集群搭建 redis集群配置 不熟悉redis请先看:redis6学习 主从复制 主从模式指的是使用一个redis实例作为主机,其余的实例作为备份机. ...

  5. Spring Boot2.x 整合quartz集群

    springboot2.x支持对quartz的自动配置,引入jar <!-- spring boot2.x + quartz --><dependency><groupI ...

  6. Redis+Keepalived内存数据库集群配置

    前言:Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API. Redis是一个key-value存储系统.和Memc ...

  7. 淘淘商城FTP服务器、Redis和solr集群配置

    这是我通过网上查找到的image_server修改而成的,已适用于2015年版本的淘淘商城视频 注意要修改该虚拟机的虚拟网卡网段为192.168.1.133,下面是一些命令:(标红的地方为必须的操作! ...

  8. springBoot整合redis集群配置

    最近发现这篇博客阅读量比较大,今天特意抽空创建了一个可运行的开源项目. 项目的代码和之前的博客内容相比,做了些优化,请大家参考项目源码. 开源项目源码: springboot-redis-cluste ...

  9. Spring Boot(十三):整合Redis哨兵,集群模式实践

    前面的两篇文章(Redis的持久化方案, 一文掌握Redis的三种集群方案)分别介绍了Redis的持久化与集群方案 -- 包括主从复制模式.哨兵模式.Cluster模式,其中主从复制模式由于不能自动做 ...

  10. springBoot整合redis单节点、redis哨兵、redis集群配置及redisClient区别

    springBoot整合redis单节点.redis哨兵.redis集群配置,redisClient jedis lettuce 区别? 1.springboot 整合redis单机模式: sprin ...

最新文章

  1. 中值定理符号怎么读_微分、微分中值定理、泰勒公式
  2. 三维点云分割综述(下)
  3. 家庭财务管理系统c语言论文,《家庭财务管理系统》-毕业论文.doc
  4. 剑指offer 算法 (抽象建模能力)
  5. 解决vmbox配置设置好自定义网桥后无法ping通问题
  6. 同方专转本计算机视频,同方2011专转本计算机
  7. java integer 不变模式_《JAVA与模式》之不变模式
  8. 什么是“云计算”,具体是怎么应用的?
  9. Python+OpenCV:Hough直线检测(Hough Line Transform)
  10. 使用abd工具查看安卓设备cpu处理器是32位或64位
  11. 合并两个有序链表js
  12. 杭州市直职称计算机考点地址,杭州中级会计考试地点在哪里
  13. 一战托福5个月112分 经验分享 + 备考资料大放送
  14. 论文笔记:Stacked Hourglass Networks for Human Pose Estimation
  15. H.264开源解码器评测
  16. Creating a universal SNP and small indel variant caller with deep neural networks理解
  17. 树莓派如何重新装Linux系统,如何给树莓派Raspberry重新安装修复操作系统
  18. LeetCode琅琊榜第九层-加油站问题(图表法)
  19. Linux下使用ftp上传压缩文件,windows下载打开损坏问题
  20. 标准和非标poe交换机如何选择

热门文章

  1. 什么是模式?什么是框架?(简述)
  2. 布局春节和情人节,知乎好物带货10年可玩
  3. 理解 Git 分支管理最佳实践
  4. python字典--在key上使用正则表达式
  5. 向日葵远程控制亮度慢慢变暗且不能调节
  6. LIMS实验室管理平台在化肥行业的应用
  7. 男人做事,要克服这些心理弱点
  8. Oracle添加字段
  9. 2023,如何为组织和自己定一个好的绩效目标?
  10. 通过a标签打开文件选择框实现文件上传