我有一个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想法中,我可以看到执行器选项卡,它似乎在那里工作,但没有网址映射。有人能帮帮忙吗?
发布于 2021-08-28 09:57:53
在您的yml配置中,您在8200上设置了管理服务器端口,而不是您的应用程序端口。因此,您仍然需要连接到您的应用程序端口(应该是8080,除非您已经将其设置为其他端口)来对您的应用程序进行健康检查。
试着这样叫它:
http://localhost:8080/actuator或者,如果您更改了端口:
http://localhost:{port}/actuatorhttps://stackoverflow.com/questions/68960338
复制相似问题