首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >运行状况终结点在spring-boot-actuator服务中不工作

运行状况终结点在spring-boot-actuator服务中不工作
EN

Stack Overflow用户
提问于 2018-02-28 22:14:14
回答 2查看 6.9K关注 0票数 2

您好,我使用的是spring boot版本- 2.0.0.RC1。我有一个运行@port9400的简单服务。

我的application.properties有以下配置:

代码语言:javascript
复制
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有:

代码语言:javascript
复制
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:

代码语言:javascript
复制
springBootVersion    = 2.0.0.RC1

当我指向http://127.0.0.1:9400/health

我收到错误屏幕作为连接的快照。

我遗漏了什么?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 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中的发行说明

票数 3
EN

Stack Overflow用户

发布于 2020-08-20 19:53:25

只需在application.properties文件中添加以下属性:

代码语言:javascript
复制
management.health.defaults.enabled=false
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49031593

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档