`
crazier9527
  • 浏览: 1004836 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Jprofiler 安装--远程监控(转)

阅读更多

WEB服务总是莫名其妙的运行一段时间后JVM直接OutOfMemory错误,这个问题一直困扰着程序的正常运行。大概半个月时间一次,上网查了些资料,也做了不少优化,什么weblogic环境变量Xms,Xmx,MaxPermSize参数调整,可问题依旧,况且这也是治标不治本,问题也许发生在程序中,可能存在内存泄露,或spring和hibernate框架相关的问题。

在网上找到个大家说很好的工具叫Jprofiler,学着弄弄,down下来个最新版本。软件需要注册,注册后有十天的试用期。现在把安装过程记下来。

由于我要监控的程序是在远程的linux系统下的weblogic服务,所以这里记录的是远程监控的配置过程。

先介绍下环境:

系统服务器:

操作系统:linux redhat

web服务器:weblogic 8.1

java虚拟机版本:1.4.2

jprofiler版本:jprofiler_linux_5_1_2.tar.gz(安装包共三个版本 sh,exe,tar.gz)

客户端:

操作系统:Windows Xp SP2

jprofiler5.1.2 for windows(安装包:jprofiler_windows_5_1_2.zip)

安装:

一.客户端安装:
1
windows下直接解压zip包,运行jprofiler5.1.2的exe安装即可。
2运行jprofiler并进行配置
1)Quick Start:
       选择 An application on a remote computer
       ->Next
2)Local or remote:
       The profiled application s located 选择 On a remote computer,
      Platform. of the remote computer 下拉菜单选择“Linux X86/AMD64”
      ->Next
3)Remote address :填写被监控应用程序所在远程计算机的IP
4)Installation directory:解压路径:/var/jprofiler5
5) choose JVM :
     JVM Vendor: Sun jvm提供商
    Version:1.4.2 版本
     Mode:hotspot 系统默认
6)jprofile port :8849
7)startup mode:
      Wait for ……   为了在开发环境中获取监控的信息,它将等待远程计算机上的Jprofile GUI 启动,并和本机建立连接,这种方式比较便于修改jprofiler的配置信息。
        Don't wait for …… 不必等待远程计算机的Jprofile GUI 先启动和建立连接,立即启动。但在启动远程应用程序前必须校验当前所配置会话的配置文件。虚拟机参数将参考Jprofile 的config 文件的路径。
这里选择Don't wait for ……
      ->Next
8) Config synchronization:
      Directory for config file in the remote computer:/opt(远程config文件的路径)
      同步方式:
    Manual synchronization;copy to diretory;execute command:
      提供三种同步方式,这里我选择的是第一个手工同步。
     ->Next
9)Perform. modifications:
     Integration type: [Generic application]
     Selected JVM: Sun 1.4.2 (hotspot)
    Startup mode: Don't wait for JProfiler GUI, startup immediately

     Important: The local config file C:\Documents and Settings\Jan\.jprofiler5\config.xml must be copied manually to /opt on the remote computer when the profiling settings are changed.


    (1) Please insert

        -Xrunjprofiler:port=8849,nowait,id=115,config=/opt/config.xml -Xbootclasspath/a:/var/jprofiler5/bin/agent.jar

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

     (2) Please add

        /var/jprofiler5/bin/linux-x86

     to the environment variableLD_LIBRARY_PATH.

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

      这里的黑体文字部分要保存下来,在服务器端安装时会用到。
      ->Next
   10) Finished:
        选No,I will start the session later
      因为我们还没有配置服务器端。

二.服务器端安装
1将jprofiler_linux_5_1_2.tar.gz上传到服务器上,/var/下建立jprofiler5目录,并将程序解压到/opt/jprofiler5下即可
2 修改用户环境变量.bash_profile。
    加入export LD_LIBRARY_PATH=/var/jprofiler5/bin/linux-x86。如果是 64 位服务器,则选择linux-x64。
    运行source .bash_profile 使环境变量立即生效
3 添加weblogic启动参数
    将一.9).(1)中黑体的部分加到weblogic的启动文件startWebLogic.sh的参数中如:
    ${JAVA_HOME}/bin/java ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -verbosegc
   -Xrunjprofiler:port=8849,nowait,id=115,config=/opt/config.xml -Xbootclasspath/a:/var/jprofiler5/bin/agent.jar
    -Dweblogic.Name=${SERVER_NAME} -Dweblogic.ProductionModeEnabled=${PRODUCTION_MODE} -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" weblogic.Server
    尽量让它在一行中。
4 把 C:\Documents and Settings\Jan\.jprofiler5\ 下的config.xml上传到服务器上,路径为一.8)中配置的Directory for config file in the remote computer:/opt
    因为这里选择的同步方式是Manual synchronization,所以以后配置发生改变时,需要手工再次上传新的config.xml到这个路径。
三.启动weblogic服务:

**************************************************
* To start WebLogic Server, use a username and   *
* password assigned to an admin-level user. For *
* server administration, use the WebLogic Server *
* console athttp://[hostname]:[port]/console    *
***************************************************
JProfiler> Protocol version 25
JProfiler> Using JVMPI
JProfiler> 32-bit library
JProfiler> Don't wait for frontend to connect.
JProfiler> Using config file /opt/config.xml (id: 114)
JProfiler> Listening on port: 8849.
[Full GC 114K->84K(520256K), 0.0063330 secs]
JProfiler> Native library initialized
JProfiler> If output stops here, please remove -Xdebug from the command line
JProfiler> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
JProfiler> Hotspot compiler enabled
JProfiler> Starting weblogic/Server ...

<Feb 5, 2008 11:41:31 AM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 1.4.2_09-b05 from Sun Microsystems Inc.>
<Feb 5, 2008 11:41:31 AM CST> <Info> <Configuration Management> <BEA-150016> <This server is being started as the administration server.>

启动本机的刚才配置好的Session,开始连接……进入监控界面。

 

感谢:http://www.51testing.com/?uid-138711-action-viewspace-itemid-173344

分享到:
评论

相关推荐

    JProfiler在Windows可视化远程监控Linux上Tomcat进程的安装步骤.pdf

    本文档详细介绍了在Windows操作系统下通过JProfiler可视化远程监控运行在Linux操作系统上的Tomcat应用服务器进程的具体步骤。 **知识点一:JProfiler概述** - JProfiler是一个集成了多种分析技术的Java剖析工具,它...

    JProfiler配置(WAS/Linux/tomcat/windows)

    - 指定远程服务器上JProfiler的安装目录。 - 提供本地的`server.xml`文件路径。 - 选择WebSphere启动服务器的命令文件。 - 设定JProfiler的监听端口。 - 验证配置环境,然后设置启动session的时间。 - 最后,点击`...

    JProfiler安装及使用

    - **安装路径**:指定远程服务器上 JProfiler 的安装路径; - **端口号**:设置通信端口,默认为 8849,需确保该端口未被其他服务占用; - **重要提示**:安装过程中,请仔细记录下配置信息,以便后续配置 Linux ...

    jprofiler 远程监控 tomcat 服务器

    《使用JProfiler远程监控Tomcat服务器的详细步骤》 在软件开发过程中,特别是对于Web应用程序,确保服务器的稳定运行和高效性能是至关重要的。而当遇到服务器崩溃或性能瓶颈时,借助于专业的监控工具,例如...

    JProfiler本地和远程配置windows版

    由于远程监控也需要在目标服务器上安装JProfiler,因此这个步骤至关重要。 ##### 步骤10:指定远程服务器启动脚本 - 将远程服务器的启动脚本复制到本地的任意位置(例如D盘根目录),并在JProfiler中选择该脚本。 ...

    jprofiler安装使用

    远程监控则用于监控远程服务器上的JVM。要实现这一功能,需要在服务器端和客户端分别进行设置。 **服务器端设置** 1. 在服务器上启动JVM时,添加以下启动参数: - `-Xbootclasspath/a:path_to_jprofiler_agent` -...

    jprofiler_windows-x64_9_2_1.exe

    7. **远程监控**:除了本地应用,JProfiler还可以远程连接到正在运行的Java应用程序进行分析,这对于分布式系统和云环境的应用性能调试非常有用。 8. **自定义事件和通知**:用户可以根据特定条件设置触发器,当...

    jprofiler监控工具使用说明

    5. **选择JDK版本**:与本地监控相同,选择远程监控所需的JDK版本。 6. **配置端口号**:与本地监控相同,设置远程监控的端口号。 7. **启动界面方式**:选择远程监控的启动模式。 #### 四、主要功能介绍 **1. ...

    jprofiler详细使用介绍

    jprofiler 的使用可以分为两部分:本地监控和远程监控。 本地监控 1. 点击 jprofiler 的可执行文件,例如 `d:/jprofiler5/bin/jprofiler.exe`。 2. 执行菜单 Session-&gt;Integration Wizards-&gt;New Server ...

    jprofiler11安装文件

    - **远程连接**:支持远程连接到Java应用程序,无需在目标机器上安装JProfiler,方便分布式系统性能测试。 ### 2. 安装过程 对于不同操作系统,JProfiler的安装步骤略有差异: - **Windows**:下载对应版本的.exe...

    jprofiler-v9.1.1.zip

    6. **远程连接**:JProfiler支持远程连接到运行中的Java应用,无需修改代码或重启服务,即可进行性能分析,这在生产环境中尤其重要。 7. **集成与扩展**:JProfiler可与Eclipse、IntelliJ IDEA等IDE集成,提供便捷...

    jprofiler_windows-x64_9_2_1

    5. **远程连接**:除了本地应用,JProfiler还支持远程连接到正在运行的Java应用,这在分布式系统中特别实用。 6. **激活码激活**:描述中提到内附激活码,这意味着用户可以免费使用该软件的全部功能,只需在安装...

    jprofiler安装文件

    6. JMX集成:JProfiler支持JMX(Java Management Extensions),允许开发者监控和管理远程应用服务器的配置和状态。 7. 自定义探查器:JProfiler允许用户创建自定义的探查器,以满足特定的性能监控需求。 四、实际...

    jprofiler_windows-x64_11_0_2.exe

    7. **远程连接**:除了本地分析,JProfiler还支持远程连接到其他运行中的JVM,方便团队协作和分布式系统的性能调试。 8. **自定义视图和事件**:用户可以根据需求创建自定义的性能指标视图,并设置触发条件,当性能...

    JProfiler在Linux上的安装和使用

    在本文中,我们将介绍如何在 Linux 平台上安装和使用 JProfiler,包括安装、配置、监控和分析等步骤。 一、安装 JProfiler 在 Linux 平台上安装 JProfiler 需要下载相应的安装包,例如 jprofiler_linux_4_3_2.tar....

    jprofiler8性能监控jboss和tomcat图文详解

    而在远程监控时,需要确保远程服务器上JProfiler的配置文件与监控端一致,并在启动脚本中添加JProfiler的代理路径参数。 【本地监控配置】对于Java应用的本地监控,首先启动JProfiler,选择"Quick Start",然后选择...

Global site tag (gtag.js) - Google Analytics