用 jconsole 监控 WebSphere AppServer JVM使用情况
环境描述:
服务端_OS:AIX 6.1
WebSphere: 6.1
客户端_OS: XP SP3
客户端JDK: SUN JDK 1.6 (如C:\Program Files\Java\jdk1.6.0_16)
------------------------------WebSphere服务器相应工作--------------------------
1.WebSphere服务器端增加JVM启动参数如下(可以在server.xml或9043/admin管理控制台增加):
网页修改位置:Servers->Server types->WebSphere application servers->server1(随应用名而定)->Process definition->Java Virtual Machine
-Djavax.management.builder.initial=
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=1099
2. WebSphere服务器调整JMX连接方式为:
SOAPConnector
3.重启WebSphere
------------------------------ windows客户端 相应工作--------------------------
1.创建一个文件夹,例如:C:\programs\jconsole\libs
2.将一些需要的jar 拷贝进入到这个libs文件夹中:
com.ibm.ws.admin.client_6.1.0.jar (在<WAS_HOME>/runtimes)
ibmorbapi.jar (在<WAS_HOME>/java/jre/lib)
ibmorb.jar (在<WAS_HOME>/java/jre/lib)
ibmcfw.jar (在<WAS_HOME>/java/jre/lib)
注:<WAS_HOME> 为websphere 安装目录
3.编写一个jconsole_monitor.bat文件
set JAVA_HOME="C:\Program Files\Java\jdk1.6.0_16" set WAS6.1_JARS=C:\programs\jconsole\libs
set BOOTJARS=%WAS6.1_JARS%\ibmorbapi.jar set BOOTJARS=%BOOTJARS%;%WAS6.1_JARS%\ibmorb.jar set BOOTJARS=%BOOTJARS%;%WAS6.1_JARS%\ibmcfw.jar
set CLASSPATH=%WAS6.1_JARS%\com.ibm.ws.admin.client_6.1.0.jar set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\jconsole.jar
%JAVA_HOME%\bin\jconsole -J-Xbootclasspath/p:%BOOTJARS% J-Djava.class.path=%CLASSPATH%
|
4.执行jconsole_monitor.bat 文件
5.在jconsole界面,新建连接->远程进程->输入如下:
service:jmx:rmi:///jndi/rmi://<IP>:1099/jmxrmi