使用 JMX/Hyperic 代理启动/停止 tc 服务器中的应用程序
有没有办法使用 JMX 或 HTTP 请求来启动、停止或重新启动 tcserver 中运行的应用程序?例如,在 tomcat 6.0 中,可以执行以下操作来启动应用程序:
http://localhost:8080/manager/start?path=/examples
当我启动 hyperic 代理时,我看不到为代理进程定义的任何 Mbean 来启动/停止 tcserver 中的运行时实例。
Is there a way to start, stop or restart applications running within tcserver using JMX or using a HTTP request? For example, in tomcat 6.0, the following can be done to start an application:
http://localhost:8080/manager/start?path=/examples
When I start the hyperic agent, I could not see any Mbeans defined for the agent process to start/stop a runtime instance within a tcserver.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Tomcat(也可能是 tcserver)为每个 WebModule 注册一个 MBean,它看起来像
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/jolokia
其中域名和 name 属性取决于您的安装和 WebModule。
每个 MBean 都有一个
start()
和一个stop()
操作。如果您使用 Jolokia 代理,您可以直接使用 HTTP 调用,例如
(斜杠需要转义,单斜杠带有/-/,双斜杠带有/--/ 请参阅Jolokia。参考手册)了解详细信息。
A Tomcat (and tcserver probably as well) registers a MBean for every WebModule which looks like
Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/jolokia
where the domain name and name property depend on your installation and the WebModule.
Each of those MBeans has a
start()
and astop()
operation.In case you are using a Jolokia agent, you can directly use an HTTP call like
(slashes needs to be escaped, single slash with /-/, double slash with /--/. See the Jolokia reference manual) for details.