spring-boot-actuator - Spring boot2 执行器健康状况为 404
问题描述
通过添加 spring-boot-starter-actuator 作为依赖项来使用 Spring Boot 2 执行器。我将服务器端口设置为 9090,将基本上下文设置为 /api。启动spring boot应用程序后,我尝试点击健康网址,例如
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=*
有人可以帮助我理解更好地使用执行器的方法吗?
解决方案
看起来您没有指定任何前缀。所以你需要直接使用/health
localhost:9090/health
我假设本地主机是这里的错字
推荐阅读
- service-worker - 工作箱预缓存不预缓存
- python - 从包含数据帧元素乘法的函数构造 2D 表面
- php - dayJS 日期函数到 PHP Carbon
- reactjs - 禁用删除按钮,直到在 react.js 中创建新卡
- elasticsearch - Elasticsearch 摄取管道:如何递归地修改 HashMap 中的值
- asp.net-mvc - 连接到在控制台应用程序中工作但在 Web 应用程序中不工作的 Microsoft Dynamics 365
- css - 以所有嵌套类中的第一个和最后一个元素为目标
- sql - 错误:列中的空值违反非空约束
- json - phpunit 断言 json_encode 数组
- javascript - Lodash:带有无关紧要的真值表