【问题标题】:Spring boot2 actuator health is giving 404Spring boot2 执行器健康状况为 404
【发布时间】:2019-06-26 10:57:56
【问题描述】:

通过添加 spring-boot-starter-actuator 作为依赖项来使用 Spring Boot 2 执行器。我将服务器端口设置为 9090,将基本上下文设置为 /api。启动 spring boot 应用程序后,我尝试点击健康 url,如

local-host:9090/application/health
local-host:9090/actuator/health
local-host:9090/api/application/health
local-host:9090/api/actuator/health

但没有成功

我试图把配置像

endpoints.actuator.enabled=true
endpoints.logfile.enabled=true
management.endpoints.web.exposure.include=*

谁能帮助我更好地理解使用执行器的方法。

【问题讨论】:

    标签: spring-boot-actuator


    【解决方案1】:

    您似乎没有指定任何前缀。 所以你需要直接使用/health

    localhost:9090/health
    

    我假设本地主机是一个错字

    【讨论】:

    • 感谢您的回复,我试过了,但还是一样。
    • 添加到上面的评论中,在日志中我收到了类似“在基本路径 '/actuator' 下暴露 15 个端点”这样的日志语句,但我仍然无法访问
    • 嗨 Aditya 谢谢你.. 它现在使用 url localhost:9090/api/actuator/health
    • 从您的角度做的任何更改?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-04
    • 1970-01-01
    • 2015-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-03
    相关资源
    最近更新 更多