`
CshBBrain
  • 浏览: 638591 次
  • 性别: Icon_minigender_1
  • 来自: 成都
博客专栏
B7d9bf34-126e-301f-819e-81f2615b5a2a
开源WebSocket服务...
浏览量:142218
Group-logo
HTML5移动开发
浏览量:135599
社区版块
存档分类
最新评论

Windows客户端的JProfiler远程监控Linux上的Tomcat

 
阅读更多

转自:http://blog.sina.com.cn/s/blog_7833c84501011q5m.html

Windows客户端的JProfiler远程监控Linux上的Tomcat:

1.       测试环境

服务器:solaris X86;tomcat 6.0;jdk 1.5;jprofiler_unix_5_2_4.sh

客户端:win7;jprofiler_windows_5_2_4.exe

 

2.       JProfiler软件下载地址 http://www.ej-technologies.com/download/jprofiler/files.html

 

3.       客户端 JProfiler 安装 

 

4.       服务器端 JProfiler 安装:

 jprofiler_unix_5_2_4.sh 上传到到服务器,假设路径为 /zpool1/gpdb_m/crmtest/menglr_18092

# cd /zpool1/gpdb_m/crmtest/menglr_18092
# chmod +x *.sh
# ./ jprofiler_unix_5_2_4.sh -c

注意,这里的 -c 意思是用字符方式来安装,如果机器上没有 X 则加上该参数

 

提示:

(1)       下载的服务器和客户端版本必须符合操作系统的类型,jprofiler支持操作系统类型为windowsMAC oslinuxSolarisAixFreeBSDHP-UX

(2)       客户端需要licence,可以通过在http://www.ej-technologies.com网站上输入用户名和邮箱来获取试用版licence,服务器端不需要licence

(3)       客户端和服务器端的版本号要一致,此例中均为5.2.4

 

5.       客户端连接配置:

(1)       运行 Jprofiler,使用向导配置,或者选择Session->Integration Wizard->New Remote Integratation

(2)       选择服务器操作系统内容:

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(3)       选择启动模式:

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(4)       输入服务器IP地址:

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(5)       输入服务器中jprofiler的安装路径:

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(6)       输入服务器中jprofiler配置文件所放位置,以及同步配置文件的方式(一般选择手动同步):

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(7)       选择服务器端JVM参数:

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(8)       设置jprofiler监控端口,默认为8849

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

(9)       最后生成一个配置说明(这个很重要!!!):

Windows客户端的JProfiler远程监控Linux上的Tomcat

 

按照以上配置说明的含义是:

首先,在配置结束后将客户端自动生成的配置文件(一般win7C:\Users\[用户名]\.jprofiler5路径下)拷贝至以上第六步中输入的服务器端jprofiler配置文件所放位置;

其次,将生成的启动项参数加入服务器端的启动文件中(tomcatcatalina.shstartup.sh

CATALINA_OPTS="-agentlib:jprofilerti=port=8849,nowait,id=105,config=/zpool1/gpdb_m/crmtest/menglr_18092/jprofiler5/config/config.xml -Xbootclasspath/a:/zpool1/gpdb_m/crmtest/menglr_18092/jprofiler5/bin/agent.jar $CATALINA_OPTS"

export CATALINA_OPTS

再次,添加jprofiler相关环境变量

export JPROFILER_HOME = /zpool1/gpdb_m/crmtest/menglr_18092/jprofiler5

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JPROFILER_HOME

 

提示:

(1)       如果以上所有步骤都完成之后,启动这个session监控,报连接失败的错误,一般情况下需要检查服务器端jprofiler相关环境变量配置是否已经配置,或者是否即时生效了;另外一种情况有可能是添加jprofiler的启动项参数不正确;

(2)       如果报JProfiler> Could not find session with id: 128的提示,说明运行java程序时,VM参数-agentlib:jprofilerti=port=8849,nowait,id=128,中最后指定的ID有误。将其修改为与config.Xml中指定的<session id="XX" name="XX" ....>...</session>相匹配的ID

(3)       如果出现License Key Not Valid的情况,则找到正确的Key,将其写入到config.xml中即可。不过这个keywindows版本破解时得到的key不同,可以考虑去jprofiler的官网上申请试用版的key

 

6.     全部配置完成之后,可以启动客户端的jprofiler,选择session>start center>Open Session
   Available session configurations
中列出了刚才配置的连接,选中使用就OK了!!

启动时服务器端日志输出包括以下内容:

JProfiler> Protocol version 27

JProfiler> Using JVMTI

JProfiler> 32-bit library

JProfiler> Don't wait for frontend to connect.

JProfiler> Using config file /zpool1/gpdb_m/crmtest/menglr_18092/jprofiler5/config/config.xml (id: 105)

JProfiler> Listening on port: 8849.

JProfiler> Native library initialized

JProfiler> VM initialized

JProfiler> Using dynamic instrumentation

JProfiler> Time measurement: elapsed time

JProfiler> CPU profiling enabled

JProfiler> Hotspot compiler enabled

JProfiler> Starting org/apache/catalina/startup/Bootstrap ...

 

jprofiler终端监控时,会出现:

JProfiler> Disconnected. Waiting for reconnection.

JProfiler> Listening on port: 8849

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics