【发布时间】:2021-08-27 23:54:51
【问题描述】:
我有一个 Spring Boot 应用程序,我在 pom.xml 中包含了 Spring Actuator
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
我的配置是这样的
management:
server:
port: 8200
endpoints:
web:
exposure:
include: "*"
endpoint:
health:
show-details: always
metrics:
enabled: false
metrics:
tags:
application: ${my.application.name}
health:
jms:
enabled: false
但是,当我尝试使用 localhost:8200/actuator 检查端点时,我的浏览器显示
This site can’t be reached
localhost refused to connect.
在我的 IntelliJ IDEA 中,我可以看到执行器选项卡,它似乎在那里工作,但没有 URL 映射。有人可以帮忙吗?
【问题讨论】:
-
检查控制台输出或记录
Exposing 2 endpoint(s) beneath base path '/actuator'之类的东西。 -
@LMC 我在日志中没有看到这一行。我有另一个服务,它的执行器正在工作,但在它的日志中也找不到这条线。
-
可能您的日志级别为 ERROR。这是整行
27-08-2021 21:00:54.911 [main] INFO o.s.b.a.e.web.EndpointLinksResolver.<init> - Exposing 2 endpoint(s) beneath base path '/actuator' -
尝试使用 127.0.0.1:8200 连接
标签: java spring spring-boot spring-actuator