从Spring Boot缓存抽象连接到Redis集群

时间:2018-06-13 14:34:45

标签: spring-boot caching redis

我正在使用具有缓存抽象支持的Spring Boot连接到redis-server来存储/获取数据以进行缓存。

我使用以下属性连接到redis-server。

spring.redis.host=localhost
spring.redis.port=6379
spring.redis.password=mypassword
spring.cache.type=redis

我能够成功连接到redis服务器并存储/获取数据。

为了实现高可用性,决定为redis服务器使用3个节点,1个主节点和2个从节点。

在这种情况下,我不确定如何提供从Spring启动应用程序连接到redis群集的配置。

spring boot是否支持连接到redis群集的任何属性。

我使用弹簧缓存抽象的开箱即用支持,支持注释 @cacheable。

我将以下2个依赖项添加到我的pom.xml中 spring-boot-starter-cache spring-boot-starter-data-redis 并使用 spring boot 1.5.13。

在spring boot中使用spring缓存抽象时是否支持连接redis集群。

0 个答案:

没有答案