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). 这里会列出需要在服务器端做的配置(very important):

Integration type: [Generic application]
Selected JVM: Sun 1.5.0 (hotspot)
Startup mode: Wait for JProfiler GUI

(1) Please insert

-agentlib:jprofilerti=port=8849  -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar

into the start command of your remote application right after the java command.

(2) Please add

/opt/jprofiler4/bin/linux-x86

to the environment variable LD_LIBRARY_PATH.

A remote session named Remote application on 192.168.40.15 will be created that connects to a running instance of the remote application that is started with the modified start command.


6.服务器端的配置
(1)修改系统环境配置文件 /etc/profile ,增加

JPROFILER_HOME=/opt/jprofiler4/bin/linux-x86
export LD_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> Protocol version 23
 JProfiler> Using JVMTI
 JProfiler> 32-bit library
 JProfiler> Listening on port: 8849.
 JProfiler> Native library initialized
 JProfiler> Waiting for a connection from the  JProfiler GUI 

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> Using dynamic instrumentation
 JProfiler> Time measurement: elapsed time
 JProfiler> CPU profiling enabled
 JProfiler> Hotspot compiler enabled
 JProfiler> Starting org/apache/catalina/startup/Bootstrap 

10.当中断JProfiler连接时
   The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:

 JProfiler> Disconnected. Waiting for reconnection.
 JProfiler> Listening on port: 8849.

各中间件配置

1、  服务端安装JProfiler(与客户端版本一致)

2、  客户端配置连接:

A)、session——integration wizards——New remote integration

B)、选择远程监控的平台windows,点击next

C)、选择jdk版本,如果服务器是64位的jdk则勾上64 bit jvm,点击next

D)、选择等待连接,点击next

E)、输入服务端ip地址,点击next

F)、输入服务端机器上的jprofiler的安装路径,点击next

G)、端口默认8849,点击next

H)、提示需要在服务端插入下面的启动命令:-agentpath:C:\jprofiler7\bin\windows\jprofilerti.dll=port=8849

客户端配置完成

 

 

3、 服务端,在C:\jboss-4.2.3.GA(2)\jboss-4.2.3.GA\bin下面编辑run.bat

加入下面的启动项-agentpath:C:\jprofiler7\bin\windows\jprofilerti.dll=port=8849

如set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -agentpath:C:\jprofiler7\bin\windows\jprofilerti.dll=port=8849

 

启动jboss,看到waiting for a connection from the JProfiler GUI… 就可以了

 

4、 配置好服务端后,继续点击客户端的next,然后再点击finish,连接即可

注:

A)、如果是tomcat则在编辑C:\my\apache-tomcat-6.0.14\apache-tomcat-6.0.14\bin下面catalina.bat

如set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" -agentpath:C:\my\jprofiler_windows_7_1_2\jprofiler7\bin\windows\jprofilerti.dll=port=8849

 

B)、如果是weblogic则编辑C:\bea\weblogic92\samples\domains\workshop\bin下面的setDomainEnv.cmd

 

如:

set JAVA_OPTIONS=%JAVA_OPTIONS% %JAVA_PROPERTIES% -Dwlw.iterativeDev=%iterativeDevFlag% -Dwlw.testConsole=%testConsoleFlag% -Dwlw.logErrorsToConsole=%logErrorsToConsoleFlag% -agentpath:C:\jprofiler7\bin\windows\jprofilerti.dll=port=8849

 

C)、如果是linux中的tomcat,则编辑/usr/local/apache-tomcat-6.0.35/bin下面的catalina.sh文件,在java_opts后面加上

-agentpath:/usr/local/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849"

(注意-agent参数要加载“之内)

如:

if [ -z "$LOGGING_MANAGER" ]; then

  JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -agentpath:/usr/local/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849"

 

else

  JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -agentpath:/usr/local/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849"

 

D)、如果是linux中的jboss,则编辑/usr/local/jboss-4.2.3.GA/bin下面的run.sh文件,在java_opts后面加上

-agentpath:/usr/local/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849

(注意-agent参数要加载“之内)

 

如:

if [ "$linux" = "true" ]; then

   JAVA_OPTS="$JAVA_OPTS -Djava.net.preferIPv4Stack=true -agentpath:/usr/local/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849"

Fi

E)、如果是linux中的weblogic,则编辑/home/weblogic/user_projects/domains/Test/bin下面的setDomainEnv.sh

 

如:

JAVA_OPTIONS="${JAVA_OPTIONS} ${JAVA_PROPERTIES} -Dwlw.iterativeDev=${iterativeDevFlag} -Dwlw.testConsole=${testConsoleFlag} -Dwlw.logErrorsToConsole=${logErrorsToConsoleFlag} -agentpath:/usr/local/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849"

export JAVA_OPTIONS

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

另一种方式(方便的操作linux+weblogic)

 

1、 客户端连接配置:

A)、session——new window,选择an application server,locally or remotely,点击next

B)、选择监控的服务器(weblogic9.2),点击next

C)、选择远程监控机器平台

D)、选择jdk版本

E)、选择立即启动,随时可以连接jprofiler,(即手动启动服务后,随时jprofiler可以连接)

F)、输入远程ip地址

G)、输入远程机器上的jprofiler的路径

H)、选择远程配置文件的路径(完成后要把本地生成的config.xml拷贝到这)

                  选择拷贝配置文件到这个路径

I)、这里选择提前在服务器上拷贝下来的startWebLogic.sh文件

J)、显示端口,点击next

K)、提示要在服务端操作的内容,点击next

2、 服务端

A)、把C:\Users\xxxxxxx\.jprofiler7\config.xml拷贝到服务器的/home/weblogic/user_projects/domains/Test/bin路径下(要设置下这个文件的可操作权限chmod a+x /home/weblogic/user_projects/domains/Test/bin/config.xml) 

B)、把F:\test\startWebLogic_jprofiler.sh拷贝到/home/weblogic/user_projects/domains/Test/bin路径下并授于可操作权

C)、./startWebLogic_jprofiler.sh启动weblogic即可

第一行是连接成功

第二行和第三行是断开

第四行是重新连接

Windows客户端的JProfiler远程监控Linux上的Tomcat的更多相关文章

  1. 转载:JProfiler远程监控LINUX上的Tomcat过程细讲

    来源于xuwanbest的博客   所谓"工欲善其事,必先利其器",好的工具确能起到事半工倍的作用.我用到的最多的就两个JConsole 和JProfiler .JConsole监 ...

  2. JProfiler远程监控Linux上Tomcat的安装过程细讲(步骤非常详细!!!)

    JProfiler远程监控Linux上Tomcat的安装过程细讲(步骤非常详细!!!) 1.文件准备: 服务器:CentOS Linux release 7.3.1611 (Core)     Apa ...

  3. Windows负载机JVM 远程监控Linux服务器下tomcat

    基本是跟着网上的操作进行的,除了遇到一个Local host name unknown的问题: 一.Linux服务器操作部分 服务器地址:10.64.111.68 首先配置JMX: 1.找到jdk目录 ...

  4. JConsole监控Linux上的Tomcat

    JConsole监控Linux上的Tomcat 从Java 5开始引入了 JConsole,来监控 Java 应用程序性能和跟踪 Java 中的代码.jconsole是JDK自带监控工具,只需要找到 ...

  5. jprofile 远程监控linux上的jvm

    环境 客户端:win7+jprofiler_windows-x64_10_0_4.exe linux服务器:tomcat7+jdk1.7+jprofiler_linux_10_0_4.sh 一.客户端 ...

  6. 记一个菜鸟在Linux上部署Tomcat的随笔

    以前都只是在园子里找各种资料.文档.各种抱大腿,今天是第一次进园子里来添砖加瓦,实话说,都不知道整些啥东西上来,就把自己在Linux上搭建Tomcat的过程记录下来,人笨,请各位大虾们勿喷. 虽然做开 ...

  7. 在linux上部署tomcat服务

    在linux上部署tomcat 1.安装JDK 2.下载tomcat http://tomcat.apache.org/download-70.cgi 3.上传到服务器,并解压 4.上传war包或者已 ...

  8. 在Linux上安装tomcat和JDK

    1.tomcat的安装 a.#cd download(进入download文件夹) b.#wget http://111.23.5.142:82/mirrors.hust.edu.cn/apache/ ...

  9. Linux上部署Tomcat+Nginx负载均衡

    前提:配置好了JDK. 我这里是vm上的linux虚拟机,可能不适用于所有情况. 一.Linux上配置Tomcat 1.下载地址:https://tomcat.apache.org/download- ...

随机推荐

  1. [转载] MFC绘制动态曲线,用双缓冲绘图技术防闪烁

    转载的原文地址 先上效果图 随着时间的推移,曲线向右平移,同时X轴的时间坐标跟着更新. 一.如何绘制动态曲线 所谓动画,都是一帧一帧的图像连续呈现在用户面前形成的.所以如果你掌握了如何绘制静态曲线,那 ...

  2. Pycharm配置autopep8让Python代码更符合pep8规范

    一.何为pep8? PEP 8官方文档 -- Style Guide for Python Code PEP8中文翻译(转) 二.Pycharm中配置pep8 Pycharm本身是有pep8风格检测的 ...

  3. 防火墙 0x80070422

    1.无法打开操作中心-安全服务,解决方法:控制面板->管理工具->服务,找到Security Center 服务,双击打开,查看启动类型是否设置成禁用,是的话更改成自动或者延迟启动,之后就 ...

  4. .NET:CLR via C# Compute-Bound Asynchronous Operations

    线程槽 使用线程池了以后就不要使用线程槽了,当线程池执行完调度任务后,线程槽的数据还在. 测试代码 using System; using System.Collections.Generic; us ...

  5. pytest文档21-pytest-html报告优化(nodeid中文显示[\u6350\u52a9\u6211\u4eec]问题解决)

    前言 pytest-html报告中当用到参数化时候,获取用例的nodeid里面有中文时候,会显示[\u6350\u52a9\u6211\u4eec]这种编码(再次声明,这个不叫乱码,这是unicode ...

  6. Spring3.1.2与Hibernate4.1.8整合

    整合Spring3.1.2 与 Hibernate 4.1.8 首先准备整合jar: Spring3.1.2: org.springframework.aop-3.1.2.RELEASE.jar or ...

  7. mybatis映射文件遇到的小问题

    mybatis的映射文件插入操作时: 如果对应的属性是String类型的,那么一定要做空串的判断. 比如注册的时候,如果需要向数据库中插入一条记录时,对应的字段没有给他赋值,这个String类型的值传 ...

  8. Objective-C:内存管理的小结

    内存管理: 1.OC的对象都是分配在堆里的      Perosn *person  = [[Person alloc]init];      Person *person       //指针类型的 ...

  9. Cesium教程系列汇总【转】

    Cesium系列目录: 演示实例 ExamplesforCesium 最近老实有一些人问我,下载后在本地无法运行,我也不能保证每次都搭个环境看是否可行,或许Cesium升级版本后真有问题呢,索性在gi ...

  10. 亚马逊AWS免费套餐EC2安装centos连接登录并创建root

    前言:刚开始使用亚马逊的AWS的免费套餐EC2,由于个人习惯使用centos系统,所以果断安装,但是AWS为了安全性,默认禁止用户使用root账户,导致安装配置环境各种问题.所以我把从安好系统后遇到的 ...