java Spring执行器未映射到localhost:xxxx/activator
我有一个Spring Boot应用程序,我在^{
<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想法中,我可以看到“执行器”选项卡,它似乎在那里工作,但没有URL映射。有人能帮忙吗
# 1 楼答案
在yml配置中,您将管理服务器端口设置为8200,而不是应用程序端口。因此,您仍然需要连接到应用程序端口(应该是8080,除非您将其设置为其他端口)以检查应用程序的运行状况
https://cloud.spring.io/spring-cloud-consul/reference/html/#registering-management-as-a-separate-service
试着称之为:
或者,如果您更改了端口: