在Windows上使用JDK 1.4进行Tomcat 5.5监控 [英] Tomcat 5.5 Monitoring with JDK 1.4 on Windows

查看:158
本文介绍了在Windows上使用JDK 1.4进行Tomcat 5.5监控的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据此文档 http://tomcat.apache.org /tomcat-5.5-doc/monitoring.html#Enabling_JMX_Remote 应该可以远程监控运行在JDK 1.4上的Tomcat 5.5服务器,但是在搜索了整个网络并尝试多个操作系统后,我仍然不能继续第一天。
我到目前为止的结果是。使用标准设置Tomcat标准

According to this documentation http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html#Enabling_JMX_Remote it should be possible to remotely Monitor a Tomcat 5.5 Server running on a JDK 1.4 but after searching all over the web and trying multiple OSs I still am no further than on day one. My results thus far are. Settign up Tomcat with the standard

-Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.port=%my.jmx.port% 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=localhost

将在JDK 1.5及更高版本上正常运行。
调试到Tomcat使我可以访问MBeanServer,但我无法从外部连接到它。根据维基百科的信息 http://en.wikipedia.org/wiki/Java_Management_Extensions
我只需要一个工作连接器,我不知道如何使其工作。

will work without any problems on JDK 1.5 and up. Debugging into Tomcat gives me access to the MBeanServer but I am not able to connect to it from the outside. According to the info from Wikipedia http://en.wikipedia.org/wiki/Java_Management_Extensions I just need a working connector and I have no idea how to get that working.

尝试根据

<Connector port="${AJP.PORT}" 
            handler.list="mx" 
            mx.enabled="true" 
            mx.httpHost="${JMX.HOST}"
            mx.httpPort="${JMX.PORT}"
            protocol="AJP/1.3" />

完全没有效果。当我调试它几乎看起来像属性handler.list和mx。*只是被忽略。我知道我应该只使用JDK 1.5,我的担忧就会消失,但我们有一个很大的JDK 1.4遗留安装基础,如果我们可以使用JMX监控,它会很棒。
最后我想使用JConsole或JVisualVM连接到Tomcat,据我所知,连接URL看起来像

has no effect at all. When I debugged it almost seemed like the attributes handler.list and mx.* were just ignored. I know I should just use JDK 1.5 and my worries would be gone but we have a large legacy install base of JDK 1.4 and it would be great if we could use the JMX monitoring. Eventually I want to use either JConsole or JVisualVM to connect to the Tomcat and as far as I have understood the connection URL would look like

service:jmx:rmi:///jndi/rmi://localhost:8888/jmxrmi

是8888是我的JMX端口。
如果有人对如何深入研究问题的根源有一些建议或想法,那将非常有帮助。

were 8888 is my JMX port. If anyone has some advice or ideas on how to drill to the root of the problem that would be very helpfull.

推荐答案

<自1.5(JDK5)以来,Java已经添加了JMX支持。要在JDK 1.4中使用它,必须下载并安装扩展 http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/download.jsp 。我没用过它,但这可能是一个起点(来自 http:// java.sun.com/developer/technicalArticles/J2SE/jmx.html

JMX support had been added to Java since 1.5 (JDK5). To use it with JDK 1.4, an extension have to be dowloaded and installed http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/download.jsp . I did'n used it but that could be a starting point (from http://java.sun.com/developer/technicalArticles/J2SE/jmx.html )


JMX技术实施

JMX Technology Implementations

Java 2平台标准版5.0(J2SE 5.0)支持JMX 1.2和JMX Remote API 1.0,它现在是官方的JMX参考实现(RI)。对于运行J2SE 1.4的开发人员,Sun Microsystems也提供了JMX RI,可以免费下载。

The Java 2 Platform, Standard Edition 5.0 (J2SE 5.0) supports JMX 1.2 and JMX Remote API 1.0, which is now the official JMX reference implementation (RI). For developers who are running J2SE 1.4, a JMX RI is also available from Sun Microsystems, and can be downloaded free of charge.

要从外面连接,请尝试删除该行

To connect from the outside, try to remove the line


-Djava.rmi.server.hostname = localhost

-Djava.rmi.server.hostname=localhost

如果您使用的是Linux,请像@vinothkr一样说对于localhost解决JMX远程连接问题(文件/ etc / hosts,将127.0.0.1替换为服务器主机名出现的行上的服务器IP)。对于Windows,我认为可以应用同样的事情。

If your are using Linux, do like @vinothkr said for localhost resolving issue on JMX remote connection (file /etc/hosts, replace 127.0.0.1 with the server IP on the line where the hostname of the server appear). For Windows, I think the same thing could applied.

关于连接器,它是您阅读的文档上jmx远程端口上的连接器。您在协议AJP / 1.3上的server.xml上设置的连接器不相关。它涉及Apache HTTPd(或其他Web服务器/负载均衡器)与Tomcat之间的通信。

About the connector, it's the connector on your jmx remote port on the documentation you read. The connector you had setup on server.xml on protocol AJP/1.3 is not related. It concern communication between Apache HTTPd (or other Web Server / Load Balancer) and Tomcat.

这篇关于在Windows上使用JDK 1.4进行Tomcat 5.5监控的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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