使用 JMX/Hyperic 代理启动/停止 tc 服务器中的应用程序

发布于 2024-11-25 04:51:14 字数 240 浏览 7 评论 0原文

有没有办法使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

睡美人的小仙女 2024-12-02 04:51:14

Tomcat(也可能是 tcserver)为每个 WebModule 注册一个 MBean,它看起来像

Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/jolokia

其中域名和 name 属性取决于您的安装和 WebModule。
每个 MBean 都有一个 start() 和一个 stop() 操作。

如果您使用 Jolokia 代理,您可以直接使用 HTTP 调用,例如

  wget -O - -q
      http://localhost:8080/jolokia/exec/Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=/--/localhost/-/jolokia/start

(斜杠需要转义,单斜杠带有/-/,双斜杠带有/--/ 请参阅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 a stop() operation.

In case you are using a Jolokia agent, you can directly use an HTTP call like

  wget -O - -q
      http://localhost:8080/jolokia/exec/Catalina:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=/--/localhost/-/jolokia/start

(slashes needs to be escaped, single slash with /-/, double slash with /--/. See the Jolokia reference manual) for details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文