【发布时间】:2021-06-16 17:30:22
【问题描述】:
我已经阅读了一些文档,并了解了如何使用 Actuator 设置就绪和活跃端点,例如 this 之一。但我无法弄清楚如何为“启动”探测设置端点。
我的应用程序 yml:
management:
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: "ALWAYS"
group:
readiness.include: readinessProbe, dataStream
startup.include: readinessProbe, dataStream
我的部署配置:
livenessProbe:
httpGet:
path: "/actuator/health/liveness"
port: "http"
initialDelaySeconds: 600
periodSeconds: 15
readinessProbe:
httpGet:
path: "/actuator/health/readiness"
port: "http"
periodSeconds: 30
failureThreshold: 15
startupProbe:
httpGet:
path: "/actuator/health/startup"
port: "http"
initialDelaySeconds: 150
periodSeconds: 10
failureThreshold: 30
执行器似乎没有提供“启动”探测的 URL,或者换句话说,http://localhost:8080/actuator/health/startup 不起作用。如何设置?
【问题讨论】:
-
错误信息是什么?您使用的是哪个 Spring Boot 版本?
-
@Thomas 错误信息是404,spring-boot版本是2.4.4
-
你的 server.servlet.contextPath 是什么?
标签: spring-boot kubernetes startup spring-boot-actuator readinessprobe