我有一个Java Spring Boot应用程序,目前在http://localhost:8080上运行。我将对该应用程序进行容器化以在Kubernetes中部署。为此,我通过在pom.xml
文件中添加以下内容启用了actuator health
端点。
<!-- Spring boot actuator to expose metrics endpoint -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
现在,应用的健康端点在 http://localhost:8080/actuator/health 上成功工作。我希望将 健康端点URL的端口修改为8081。(这是为了确保我可以将8080端口公开并将8081端口仅暴露给负载均衡器。这是个人偏好)
如何更改健康端点的端口,以便健康端点的URL变为http://localhost:8081/actuator/health,并且应用程序运行在http://localhost:8080/上。
springboot5+
==springboot1.5+
吗? - Lei Yang