---
title: "转-Linux安装使用jprofiler6 远程监控Tomcat运行情况"
author: "lvmlvy"
date: "2013-07-19T13:58:06Z"
tags: []
categories: ["操作系统"]
slug: "linux-jprofiler6-tomcat"
draft: false
lastmod: "2013-10-28T13:46:31Z"
id: 1910135
url: "https://lvmlvy.iteye.com/blog/1910135"
---

## Linux安装使用jprofiler6 远程监控Tomcat运行情况

 

1、安装环境：虚拟机：ha\_vmware.exe     Linux ：Red Hat Linux Enterprise 5

2、准备工作：

   (a)下载 jdk for linux:   jdk-6u20-linux-i586-rpm.bin([安装步骤我的博客上有 请仔细查看](http://hi.baidu.com/%CA%B1%C0%DA%D4%B5%C0%B4%CA%C7%C4%E3/blog/item/7efb7317aab2dd0d962b432e.html)  )

   (b)下载tomcat for linux :apache-tomcat-6.0.32.tar.gz ([安装步骤我的博客上有 请仔细查看](http://hi.baidu.com/%CA%B1%C0%DA%D4%B5%C0%B4%CA%C7%C4%E3/blog/item/154615fcf25ba70309244d95.html)  )

   (c)下载jprofiler\_linux\_6\_2\_4.rpm（ [http://www.ej-technologies.com/products/jprofiler/overview.html](http://www.ej-technologies.com/products/jprofiler/overview.html)） 和jprofiler\_windows\_6\_2\_4.exe

3、安装   linux安装的部分：（前提为tomcat 和 jdk  安装完毕 ）

   (a) .  jprofiler\_linux\_6\_2\_4.rpm  （重命名为：jprofiler6.rpm  ）

                         执行命令：rpm -ivh jprofiler6.rpm     即可（cope jprofiler6.rpm   到 opt 目录下   安装后生产 jprofiler6目录 ）

   (b).  进入tomcat 安装目录 copestartup.sh（tomcat/bin）脚本拷贝到本地windows的某个目录中      　　

4、windows安装的部分：运行jprofiler\_windows\_6\_2\_4.exe，直接安装即可

                  注意的地方：序列号 版本号必须相同  否则无法连接                                           

（a）安装完毕后启动。安装完毕后会提示你输入lisencekey，输入你的key；

（b）启动后，在start center  --&gt; new  session 菜单下点击new session菜单，new server Integration

（c）选择下一步，弹出应用服务器选择界面，我这里选择tomcat6；

（d）选择下一步，选择“on remote computer”，同时选择操作系统相关信息，这里我选择linuxx86，amd64；

（e）选择下一步，这里将我们jdk相关信息选择上，我选择“sun”、“1.6.0”、“hotspot”；

（f）选择下一步，这里我选择第二个“startup immediately.connectl ater with  jprofilerGUI”；

（g）选择下一步，填写要连接的远程服务器ip，这里我填写192.168.206.10；

（h）选择下一步，这里需要填写的是jprofiler在linux上的安装位置。这里填写/opt/jprofiler6；

（r）选择下一步，这里需要我们将刚才从服务器上拿下来的startup.sh脚本选中，

          ![](http://hiphotos.baidu.com/%CA%B1%C0%DA%D4%B5%C0%B4%CA%C7%C4%E3/pic/item/81d6721273f08202c9d62a884bfbfbedaa641b5b.jpg)

 

          点击下一步后，我们制定一个端口，默认是8849，（千万别用80或者8080这些知名端口），会生成一个startup\_jprofiler.sh脚本，

          而这个脚本就是比我们原来的startup.sh多如下一段话：

          # The following lines have been added by the  
          # application server integration wizard of JProfiler  
           CATALINA\_OPTS="-agentpath:/opt/jprofiler6/bin/linux-x86/libjprofilerti.so=port=8849 $CATALINA\_OPTS"  
           export CATALINA\_OPTS

5、将刚才生成startup\_jprofiler.sh脚本传送到/usr/local/tomcat6/bin的目录下，并赋予执行权限chmod  777 startup\_jprofiler.sh

6、当我们想让jprofiler监控的时候，直接用startup\_jprofiler.sh启动tomcat

7、然后我们在本地打开刚才配置的链接，就能直接链接到linux的8849端口进行服务器状态监控了

8、至此祝你安装成功，谢谢！