Spring Boot 2 Actuator 是否在外部 Tomcat 中工作 [英] Does Spring Boot 2 Actuator work in external Tomcat

查看:63
本文介绍了Spring Boot 2 Actuator 是否在外部 Tomcat 中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Spring Boot 2 应用程序,它最初使用嵌入式 Tomcat 来运行.在项目中包含 Actuator,我可以做到

I've got a Spring Boot 2 app that initially used the embedded Tomcat to run. Having Actuator included in the project, I could do

curl 'http://localhost:8080/actuator/health'

并得到回复.

现在我已将应用程序移动到要部署到外部 Tomcat (8.2.23) 的 WAR 文件中,并且不再找到执行器端点.应用程序本身仍然有效,但我无法访问公开的执行器端点.

Now I've moved the app into a WAR file to be deployed into an external Tomcat (8.2.23), and the actuator endpoint is no longer found. The app itself still works, but I can't get to the exposed actuator endpoints.

这是已知错误(功能"?),还是需要特殊配置?我目前没有尝试定义任何新的执行器端点.我也不包括安全性.

Is this a known bug ('feature'?), or is there a special configuration needed? I'm not currently trying to define any new actuator endpoints. I also don't have security included.

推荐答案

在外部 tomcat 中部署时,您的应用程序的所有其余端点现在都将变为 http://localhost:8080/{Name of war file}/实际终点

When deploying in external tomcat, all rest end points of your application will now become http://localhost:8080/{Name of war file}/actual-end-point

这篇关于Spring Boot 2 Actuator 是否在外部 Tomcat 中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆