您好,我使用的是spring boot版本- 2.0.0.RC1。我有一个运行@port9400的简单服务。
我的application.properties有以下配置:
spring.main.banner-mode = CONSOLE
spring.profiles.active = ${profile:local}
server.compression.enabled = true
server.compression.min-response-size = 1
server.compression.mime-types = application/json,application/xml,text/xml,text/plain
banner.charset = UTF-8
management.endpoints.health.show-details=true
management.server.address: 127.0.0.1
management.endpoints.web.expose: health,info,metrics,mappings,trace
management.endpoints.health.show-details: true
management.endpoints.health.time-to-live: 2000
management.security.enabled: false
management.health.defaults.enabled: false
management.health.diskspace.enabled: true我的build.gradle有:
dependencies {
// Spring Boot
compile group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: springBootVersion
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: springBootVersion
}我的gradle.properties:
springBootVersion = 2.0.0.RC1当我指向http://127.0.0.1:9400/health 时
我收到错误屏幕作为连接的快照。
我遗漏了什么?

发布于 2018-03-01 00:02:15
您提供的show-details值不是有效值...无论如何,在Spring Boot2.0中,执行器端点(如健康)被重新映射到/ actuator /*。现在,运行状况位于/actuator/health。
有关更多信息,请参阅https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0.0-RC2-Release-Notes#health-endpoint中的发行说明
发布于 2020-08-20 19:53:25
只需在application.properties文件中添加以下属性:
management.health.defaults.enabled=falsehttps://stackoverflow.com/questions/49031593
复制相似问题