SpringCloud HTTP运行状况检查
2023-12-04 15:57 更新
Consul实例的运行状况检查默认为“ / health”,这是Spring Boot Actuator应用程序中有用端点的默认位置。如果您使用非默认上下文路径或Servlet路径(例如server.servletPath=/foo)或管理端点路径(例如management.server.servlet.context-path=/admin),则即使对于Actuator应用程序,也需要更改它们。也可以配置Consul用于检查运行状况端点的间隔。“ 10s”和“ 1m”分别代表10秒和1分钟。例:
application.yml。
spring:
cloud:
consul:
discovery:
healthCheckPath: ${management.server.servlet.context-path}/health
healthCheckInterval: 15s
您可以通过设置management.health.consul.enabled=false来禁用运行状况检查。
以上内容是否对您有帮助:

免费 AI IDE


更多建议: