1客户端连接配置
如果服务器上安装了jprofiler可以选择->Anapplication on sever, Locally or Remotely
然后, ,服务器类型选择ApacheTomcat。在Locate start script中可以选择启动文件catalina.sh,JP会自动生成catalina_jprofiler.sh.本地就无需再服务器得配置.
如果没有需要把windows的安装的jp的文件上转到/opt/jp下,并修改属组
1). 运行JProfiler 。第一次打开会有向导,选择An application on remotecomputer。
2). 选择Session->Integration Wizard->New Remote Integratation
3). 选择On a remote computer;Platform. of remotecomputer 选择 Linux x86/AMD 64;Next
4). 输入服务器IP ;Next
5). 输入服务器上的jprofiler 的安装路径,如 /opt/jp ;next
6). 选择服务器的JDK 环境,这里是:Sun,1.5.0,hotspot;next
7). 输入端口:这里是默认值 8849;next
8). 选择启动模式:这里选第2种 don’t wait ,startupimmediately; next
9). 输入服务器上的jprofiler 的配置文件路径 如 /opt/jp ;next
10).这里会列出需要在服务器端做的配置:
如:
(3)Please insert
-agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jp/bin/agent.jar
into the start command ofyour remote application right after the java command.
(4)Please add
/opt/jp/bin/linux-x86
to the environmentvariable LD_LIBRARY_PATH.
A remote session namedRemote application on xxx.xx.xx.xx will be created that connects to a runninginstance of the remote application that is started with the modified startcommand.
11).上传本地机器C:\Documentsand Settings\XXX\.jprofiler4\config.xml 文件,到先前step 9 jprofiler的配置文件路径中。
2服务器端连接配置
1) 修改系统环境配置文件/etc/profile,增加以下内容
JPROFILER_HOME=/opt/jp/bin/linux-x86
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JPROFILER_HOME
2)TOMCAT是用startup.sh启动的,但是我们需要修改启动文件是/bin/catalina.sh,添加
-agentlib:jprofilerti=port=8849-Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar 内容到CATALINA_OPTS中;
在CATALINA_OPTS=处添加
CATALINA_OPTS=$CATALINA_OPTS-Xms128m -Xmx128m $JPDA_OPTS -agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar
原文:http://hi.baidu.com/lightao220/blog/item/c9a13bd00cef4f3107088b84.html