简体   繁体   English

什么是Tomcat运行?

[英]What is Tomcat Running?

I'm trying to see if a WAR I just built is even running inside of Tomcat ( 7.0.19 ). 我试图看看我刚刚构建的WAR是否在Tomcat( 7.0.19 )内部运行。 I am deploying to a linux box and so my only two options are the Tomcat admin console (web app) or, hopefully, determining webapp status through the terminal. 我正在部署到一个linux盒子,所以我唯一的两个选择是Tomcat管理控制台(web app),或者希望通过终端确定webapp状态。

I already know how to get in through the console web app; 我已经知道如何通过控制台Web应用程序进入; I am wondering if there is any way to see the status (ACTIVE/INACTIVE/TERMINATED, etc) of deployed web apps from the terminal. 我想知道是否有任何方法可以查看终端部署的Web应用程序的状态(ACTIVE / INACTIVE / TERMINATED等)。

Thanks in advance. 提前致谢。

PSI-Probe is a great application for monitoring your applications deployed to a tomcat instance. PSI-Probe是一个很好的应用程序,用于监视部署到tomcat实例的应用程序。 It will tell you if an application is running or down. 它会告诉您应用程序是在运行还是在运行。 If the application is not deployed, it will simply not be in the list. 如果未部署应用程序,则它将不在列表中。

You can probably do it using JMX. 您可以使用JMX来完成它。 Find appropriate MBean that shows this information on local tomcat using regular JConsole. 查找使用常规JConsole在本地tomcat上显示此信息的相应MBean。 If you want to connect JConsole to remote you will probably have some problems with firewall, so you have other solution. 如果您想将JConsole连接到远程,您可能会遇到防火墙问题,因此您有其他解决方案。

Take command line JMX client and run it on the monitored host through SSH terminal. 使用命令行JMX客户端,并通过SSH终端在受监控主机上运行它。 I used the following command line JMX client: cmdline-jmxclient-0.10.3.jar 我使用了以下命令行JMX客户端: cmdline-jmxclient-0.10.3.jar

wget http://<username>:<password>@<hostname>:<port>/manager/list -O - -q

(虽然不确定Tomcat 7)

curl --user user:pass http://localhost:8080/manager/text/list

It prints 它打印

OK - Listed applications for virtual host localhost
/manager:running:0:manager
/docs:running:0:docs
/examples:running:0:examples
/host-manager:running:0:host-manager
/myapp:running:0:myapp

Your user needs the manager-script role. 您的用户需要manager-script角色。 Documentation: Manager App HOW-TO, List_Currently_Deployed_Applications 文档: Manager App HOW-TO,List_Currently_Deployed_Applications

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM