如何在Websphere中启用JMX? [英] How do you enable JMX in Websphere?

查看:457
本文介绍了如何在Websphere中启用JMX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用JConsole来监控我的Websphere应用程序,但我不知道如何启用JMX。

I would like to use JConsole to monitor my Websphere application, but I am not sure how to enable JMX.

推荐答案

以下信息适用于Windows上的Websphere 6.1。

Following information is for Websphere 6.1 on Windows.

首先,连接到MBean服务器的神奇URL是:

First of all, the magic URL to connect to the MBean server is:

service:jmx:iiop://<host>:<port>/jndi/JMXConnector

如果您有默认的Websphere安装,JNDI端口号可能是2809,2810,...取决于一个系统上安装的服务器数量和特定的一个你想连接到。可以肯定的是,在启动Websphere时,检查日志,因为它会转储一行如

If you have a default Websphere installation, the JNDI port number will likely be 2809, 2810, ... depending on how many servers there are installed on one system and the specific one you want to connect to. To be sure, when starting Websphere, check the logs, as it will dump a line like

0000000a RMIConnectorC A   ADMC0026I: The RMI Connector is available at port 2810

如果您没有获得此行,请打开Websphere管理控制台,转到

If you don't get this line, open the Websphere admin console and go to


应用程序服务器> server1>
管理服务> JMX
连接器

Application servers > server1 > Administration Services > JMX connectors

看看你是否需要添加或更改配置。

to see if you need to add or change the config.

第二个重要的信息是在与服务器进行JMX时总是需要以下JAR:

Second important bit of information is that the following JAR is always needed when doing JMX with the server:

com.ibm.ws.admin.client_6.1.0.jar

您可以在运行时中找到此JAR Websphere目录。无论您做什么,无论是以编程方式访问Websphere上的MBean,还是使用JConsole等,都使用魔术URL,始终包含此JAR。

You can find this JAR in the the runtimes directory of Websphere. Whatever you do, whether programmatically accessing MBeans on Websphere, or using JConsole, and so on, use the magic URL and always include this JAR.

对于本答案的其余部分,假设Websphere安装在D:\ prog \ was61中。

For the remainder of this answer, assume that Websphere is installed in D:\prog\was61.

要运行JConsole,请键入以下内容:

To run JConsole, type in the following:

D:\prog\was61\java\bin>jconsole -J-Djava.class.path=d:\prog\was61\java\lib\tools.jar;D:\prog\was61\runtimes\com.ibm.ws.admin.client_6.1.0.jar

然后转到高级标签并输入神奇的JMX URL。按连接,您应该看到MBean出现。

Then go to the "Advanced" tab and type in the magic JMX URL. Press connect and you should see the MBeans appear.

使用Sun JDK是完全不同的事情。您需要一个额外的JAR,它位于IBM JDK的lib中,但不是Sun的(ibmorb.jar),并且以下命令可能适用于您:

Using a Sun JDK is an entirely different matter. You need one extra JAR that is in the lib of the IBM JDK but not Sun's (ibmorb.jar), and maybe the following command may work for you:

C:\Program Files\Java\jdk1.5.0_11\bin>jconsole -J-Djava.class.path="c:\Program Files\Java\jdk1.5.0_11\lib\jconsole.jar";"c:\Program Files\Java\jdk1.5.0_11\lib\tools.jar";D:\prog\was61\runtimes\com.ibm.ws.admin.client_6.1.0.jar;D:\prog\was61\java\jre\lib\ibmorb.jar

我想也许,因为它对我不起作用。我得到了一个很好的jndiUnavailCommErr错误消息,因为当我的Websphere安装正在监听2810时,它期望端口2809上的某些东西,尽管我在JMX URL中正确指定了端口2810。但是,如果您调整路径以指向Sun JDK,它可能适合您。这是我使用Sun的JDK连接到Websphere最接近的。

I say maybe, because it didn't work for me. I got a nice jndiUnavailCommErr error message, since it expected something on port 2809 while my Websphere installation is listening on 2810, although I correctly specified port 2810 in the JMX URL. But, if you adapt the paths to point to your Sun JDK, it might work for you. It's the closest I ever got to connecting to Websphere using Sun's JDK.

最后的注意事项:我尝试了基于RMI的解决方案,还有一个SOAP连接器可用但是没有'尝试过它。

Final note: I tried a solution based on RMI, there is also a SOAP connector available but haven't tried it.

与J2EE,Websphere一样:好运,你需要它。

As always with J2EE, Websphere and stuff: good luck, you'll need it.

这篇关于如何在Websphere中启用JMX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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