如何解决在 spring-starter-data-redis 中使用生菜代替 jedis 时活性探测失败
我有一个使用 spring cloud bom 的 spring boot 应用程序:Hoxton.SR1
应用部署在 kubernetes 集群中。
为了将应用程序连接到 redis 数据库,我测试了 2 种不同的配置:
- Jedis 连接池配置:
pom.xml
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<exclusions>
<exclusion>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- jedis -->
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
</dependency>
application.yml
:
spring:
redis:
host: localhost
port: 6379
password: password
database: 0
jedis:
pool:
min-idle: 0
max-idle: 12
max-active: 12
max-wait: 500ms
在 K8S 集群中部署效果很好。
- 生菜连接池配置:
pom.xml
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--lettuce connection pool-->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
application.yml
:
spring:
redis:
host: localhost
port: 6379
password: password
database: 0
lettuce:
pool:
min-idle: 0
max-idle: 12
max-active: 12
max-wait: 500ms
在 K8S 集群中部署不起作用,错误是:Liveness probe failed: Get http://10.68.13.246:8080/actuator/health: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
。
我错过了什么? 这可能是什么根本原因? 是否与弹簧执行器或生菜接头有关?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。