简体   繁体   English

Jboss / Tomcat监视器

[英]Jboss/Tomcat monitor

I'm looking for a tool (in linux) that can montior a tomcat/jboss process and if the process fails, I can respawn either or both without having to manually ssh into the box, do any house keeping and then start them up again. 我正在寻找一个可以监视tomcat / jboss进程的工具(在Linux中),如果该进程失败,我可以重新生成其中一个或两个,而不必手动将其放入框内,进行任何内部维护,然后再次启动它们。 I'm not too sure if there is a good tool out there that can monitor the health of jboss/tomcat and report on it's performance. 我不太确定是否有一个好的工具可以监视jboss / tomcat的运行状况并报告其性能。 I know jvisualvm gives you various tools, but I'm looking for a disaster recovery solution that is a bit higher level than jvisualvm. 我知道jvisualvm提供了各种工具,但是我正在寻找一种比jvisualvm更高级别的灾难恢复解决方案。

Java Service Wrapper is an application that wraps your Java process and installs it in the system using service (Windows) or daemon (Linux). Java Service Wrapper是一个应用程序,用于包装Java进程,并使用服务(Windows)或守护程序(Linux)将其安装在系统中。 It pings the VM periodically and restarts it when it does not respond. 它会定期对VM进行ping操作,然后在不响应时重新启动它。 Worked for us in production with several application, including Tomcat, JBoss, Mule, etc. Actually Mule ESB is even bundled with this application in the distribution. 在生产中为我们使用了多个应用程序,包括Tomcat,JBoss,Mule等。实际上,Mule ESB甚至与该应用程序捆绑在发行版中。

Also you don't have to run the application manually when the system starts. 另外,系统启动时,您也不必手动运行该应用程序。

I'm currently working on a daemon to do this and more, since JOPR nor naggios didn't do what we needed, but those are good tools you could use. 由于JOPR和naggios并没有完成我们所需要的工作,因此我目前正在开发一个守护程序来完成此任务以及更多操作,但是这些都是您可以使用的好工具。 I'm not sure but JOPR (or whatever is called today) can restart your servers in case something goes wrong. 我不确定,但是JOPR(或今天所说的任何东西)可以在出现问题时重新启动服务器。

A custom made solution as we're working on shouldn't take you more than a week. 我们正在研究的定制解决方案最多不会花您一周的时间。 The main problem, is that to start either JBoss or Tomcat you have to call the startup scripts. 主要问题在于,要启动JBoss或Tomcat,您必须调用启动脚本。 But the startup script will restart the service if the exit code is 10, something like this: 但是,如果退出代码为10,则启动脚本将重新启动服务,如下所示:

while $? -ne 10; do
  start_jboss
done

So, this daemon which is made in Java uses JMX to connect to the JBoss server and tells JBoss to go down and exit with status code 10 using a method in a MBean. 因此,该Java守护进程使用JMX连接到JBoss服务器,并使用MBean中的方法告诉JBoss退出并以状态代码10退出。 I'm at home, so I'm not sure the exact name of the MBean you have to call for this but I'll provide more info tomorrow. 我在家里,所以不确定要为此调用的MBean的确切名称,但明天我将提供更多信息。

我正在使用monit来控制Tomcat / JBoss的启动。

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

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