【问题标题】:Spring Application Availability (Liveness and Readiness) Returns 404Spring 应用程序可用性(Liveness 和 Readiness)返回 404
【发布时间】:2020-08-01 02:36:25
【问题描述】:

我有一个 Spring Boot 应用程序 (v2.3.2) 并启用了执行器健康组以实现活跃性和就绪性:

management:
  endpoints:
    enabled-by-default: false
  endpoint:
    health:
      enabled: true
      probes:
        enabled: true

然后GET /actuator/health 返回:

{
    "groups": [
        "liveness",
        "readiness"
    ],
    "status": "UP"
}

根据文档,我应该也可以GET /actuator/health/livenessGET /actuator/health/readiness,但都返回404
我错过了任何配置吗?

【问题讨论】:

    标签: java spring spring-boot


    【解决方案1】:

    这应该可以工作

    management:
      endpoints:
        enabled-by-default: false
      endpoint:
        health:
          enabled: true
          probes:
            enabled: true
          group:
            liveness:
              include: "livenessStateProbeIndicator"
            readiness:
              include: "readinessStateProbeIndicator"
    

    由于issue,这是一种解决方法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-11-25
      • 2018-02-11
      • 1970-01-01
      • 2019-05-18
      • 1970-01-01
      • 2020-12-13
      • 2022-01-01
      相关资源
      最近更新 更多