Discovery Client 未针对 Spring Health Actuator 进行初始化

问题描述 投票:0回答:1

我正在尝试运行 OpenAPI 生成的 Spring boot 应用程序。我在我的

application.yml

中设置了以下配置
# Actuator Configuration

management:
  endpoints:
    web:
      exposure:
        include: "*"
  endpoint:
    health:
      enabled: true
  health:
    defaults:
      enabled: false
    refresh:
      enabled: false
    db:
      enabled: false
    diskspace:
      enabled: false
    vault:
      enabled: false      
health:
  config:
    enabled: false

但是当我运行端点

/actuator/health
时,我收到以下响应:

{
"description": "Discovery Client not initialized",
"status": "UNKNOWN"
}

注意:

Spring Boot 版本:2.2.1.RELEASE

spring spring-boot spring-boot-actuator health-check
1个回答
0
投票

删除

management.health.defaults.enabled=false
或使其等于
true

© www.soinside.com 2019 - 2024. All rights reserved.