??查看官方文檔
-
spring-boot-starter-actuator官方文檔
-
Spring Boot 包含許多附加功能,可幫助您在將應(yīng)用程序投入生產(chǎn)時(shí)監(jiān)控和管理應(yīng)用程序。您可以選擇使用 HTTP 端點(diǎn)或 JMX 來管理和監(jiān)控您的應(yīng)用程序。審核、運(yùn)行狀況和指標(biāo)收集也可以自動應(yīng)用于您的應(yīng)用程序。文章來源:http://www.zghlxwxcb.cn/news/detail-801846.html
-
該spring-boot-actuator模塊提供了 Spring Boot 的所有生產(chǎn)就緒功能。啟用這些功能的推薦方法是添加對spring-boot-starter-actuator“Starter”的依賴項(xiàng)。文章來源地址http://www.zghlxwxcb.cn/news/detail-801846.html
??導(dǎo)入pom文件
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>
??公開端點(diǎn)
management:
endpoints:
web:
exposure:
include:
- info
- health
jmx:
exposure:
exclude: "*"
endpoint:
info:
enabled: true
health:
enabled: true
??無法訪問分析
- 檢查是否按照上面的步驟做了
- 檢查訪問路徑是否正確
- 按照以下訪問路徑
http://localhost:{server.port}/{server.servlet.context-path}/{management.endpoints.web.base-path}/**
沒有設(shè)置可以忽略
- 按照以下訪問路徑
到了這里,關(guān)于java Spring Boot 2 /actuator/health 返回 HTTP 404的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!