springboot整合redis集群
springboot整合redis集群 yls 2019-9-21 简介 在springboot使用搭建好的redis集群 添加redis和连接池依赖 <!--redis连接池 start--> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-pool2</artifactId> </dependency> <!--redis连接池 end--> <!--redis start--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!--redis end--> 在配置文件中配置连接池和sentinel spring: redis: lettuce: pool: max-active: 8 max-idle: 8 max-wait: -1ms min-idle: 0 sentinel: master: mymaster nodes: 192.168.145.128:26379,192.168.145.128:26380,192.168.145.128:26381 创建redis服务