1.测试环境
服务器:RedHat Linux 3.4.3-9.EL4(内核版本 2.6.9-5.EL),Tomcat5.5.20,Sun JDK 1.5.0_09,JProfiler 4.3.2 for linux(安装包:jprofiler_linux_4_3_2.sh)
客户端:Windows XP,JProfiler 4.3.2 for windows(安装包:jprofiler_windows_4_3_2.exe)
2.JProfiler软件下载地址http://www.ej-technologies.com/
3.客户端 JProfiler 安装 略
4.服务器端 JProfiler 安装:
把 jprofiler_linux_4.3.2.sh 上传到到服务器,假设路径为 /opt/jprofiler
# cd /opt/jprofiler
# chmod +x *.sh
# ./jprofiler_linux_4.3.2.sh -c
按照提示来安装,提示都很简单,不在多说。安装路径选择 /opt/jprofiler4
注意,这里的 -c 意思是用字符方式来安装,如果机器上没有 X 则加上该参数.
5.客户端连接配置
1). 运行 JProfiler 。第一次打开会有向导,忽略它。
2). 选择 Session->Integration Wizard->New Remote Integratation
3). 选择 On a remote computer;Platform of remote computer 选择 Linux x86/AMD 64;Next
4). 输入服务器 IP ;Next
5). 输入服务器上的 jprofiler 的安装路径,如 /opt/jprofiler4 ;next
6). 选择服务器的 JDK 环境,这里是:Sun,1.5.0,hotspot;next
7). 输入端口:这里是默认值 8849;next
8). 选择启动模式:这里选第一种 wait for a connection from the jprofiler GUI;next
9). 这里会列出需要在服务器端做的配置:
Integrationtype:[Genericapplication]
SelectedJVM:Sun1.5.0(hotspot)
Startupmode:WaitforJProfilerGUI
(1)Pleaseinsert
-agentlib:jprofilerti=port=8849-Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar
intothestartcommandofyourremoteapplicationrightafterthejavacommand.
(2)Pleaseadd
/opt/jprofiler4/bin/linux-x86
totheenvironmentvariableLD_LIBRARY_PATH.
AremotesessionnamedRemoteapplicationon192.168.40.15willbecreatedthatconnectstoarunninginstanceoftheremoteapplicationthatisstartedwiththemodifiedstartcommand.
6.服务器端的配置
(1)修改系统环境配置文件 /etc/profile ,增加
JPROFILER_HOME=/opt/jprofiler4/bin/linux-x86
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JPROFILER_HOME
(2)修改TOMCAT启动文件catalina.sh,添加-agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar 内容到CATALINA_OPTS中;
“-agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar ” 此内容由客户端软件生成
CATALINA_OPTS="$CATALINA_OPTS-Xms128m-Xmx128m$JPDA_OPTS-agentlib:jprofilerti=port=8849-Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar"
7.Reboot Linux and startup Tomcat using startup.sh;
The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:
JProfiler>Protocolversion23
JProfiler>UsingJVMTI
JProfiler>32-bitlibrary
JProfiler>Listeningonport:8849.
JProfiler>Nativelibraryinitialized
JProfiler>WaitingforaconnectionfromtheJProfilerGUI
8.启动客户端软件
点击jprofiler菜单 session>start center>Open Session
Available session configurations中列出了刚才配置的连接,选中使用就OK了!!
9.The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:
JProfiler>Usingdynamicinstrumentation
JProfiler>Timemeasurement:elapsedtime
JProfiler>CPUprofilingenabled
JProfiler>Hotspotcompilerenabled
JProfiler>Startingorg/apache/catalina/startup/Bootstrap
10.当中断JProfiler连接时
The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:
JProfiler>Disconnected.Waitingforreconnection.
JProfiler>Listeningonport:8849.
分享到:
相关推荐
JProfiler是一款功能强大的Java剖析工具,专为Java开发人员设计,用于监视...以上步骤和知识点可以帮助IT专业人员顺利完成在Windows上通过JProfiler对Linux上Tomcat进程的远程监控,确保应用程序运行的稳定性和高效性。
- 在Windows上安装`jprofiler_windows_7_1_2.exe`,安装过程中需要输入序列号(license key)。 **1.3 配置客户端** - 拷贝WebSphere的`server.xml`和`startServer.sh`到本地指定目录。 - 打开JProfiler客户端,...
而在Linux系统上监控远程JVM时,则需要在客户端安装JProfiler Windows版本,并在服务端安装JProfiler Linux版本,两者之间通过socket通信进行交互。 JProfiler的监控方式主要分为三种模式: 1. 等待模式:在这种...
在Windows上安装JProfiler非常直观: 1. 下载适用于Windows的JProfiler安装包,例如`jprofiler_windows_6_2_4.exe`。 2. 双击安装文件,选择继续安装32位版本(即使在64位系统上也可以)。 3. 设置安装路径,接受...
- **安装**: 安装过程简单直观,支持多种操作系统(Windows、MacOS、Linux等)。安装程序会指导用户完成整个过程,并确保所有必要的依赖项都被正确配置。 #### 三、剖析一个JVM - **启动配置**: 在启动JVM时需要...