将测试进行到底!

配置jprofiler对weblogic进行监控

上一篇 / 下一篇  2010-06-25 16:37:56 / 个人分类:JAVA


1、首先准备windows版本的jprofiler和对应被监控服务器端操作系统版本的jprofiler,这里服务器端是Linux版本的操作系统


2、先安装服务器端的jprofiler(rpm、sh、tar)

[root@localhost /]# chmod +x jprofiler_linux_4_3_2.rpm
[root@localhost /]# rpm -ivh jprofiler_linux_4_3_2.rpm

服务器操作系统 Linux OS ,安装步骤如下:
1、./jprofiler_linux_4_1_2.sh,出现如下提示:
testing JVM in /usr/jdk1.4 ...
Starting Installer ...
注:对于没有安装X Server的机器,需要执行./jprofiler_linux_4_1_2.sh -q,否则会提示,
testing JVM in /usr/jdk1.4 ...
Starting Installer ...
This installer needs access to an X Server.
If this is not possible, you can run the installer in unattended mode
by passing the argument -q to the installer.
2、安装完毕后,会在/opt目录下,找到jprofiler的安装目录,/opt/jprofiler4。


3、安装客户端后根据提示信息进行配置,最后出现下面提示:

(1) Please insert

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

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

(2) Please add

/opt/jprofiler3/bin/linux-x86

to the environment variable LD_LIBRARY_PATH.

A remote session named Remote application on 192.163.0.1 will be created that

connects to a running instance of the remote application that is started with the

modified start command.


4、服务器端配置环境变量

编辑vi /etc/profile
加入下面的代码

JPROFILER_HOME=/opt/jprofiler4
export LD_LIBRARY_PATH=$JPROFILER_HOME/bin/linux-x86

执行source /etc/profile,使其生效,然后重启终端


5、weblogic用户登录,配置修改bin/setDomainEnv.sh 加入JAVA_OPTIONS

JAVA_OPTIONS="${JAVA_OPTIONS} ${JAVA_PROPERTIES} -Dwlw.iterativeDev=${iterativeDevFlag} -Dwlw.testConsole=${testConsoleFlag} -Dwlw.logErrorsToConsole=${logErrorsToConsoleFlag}"

将下面补充到已有的JAVA_OPTS后,保持在一行中

JAVA_OPTIONS="${JAVA_OPTIONS} -agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar"
export JAVA_OPTIONS

 

6、启动./startWebLogic.sh,在log中可以看到下面的信息,说明可以在客户端使用jprofiler对weblogic进行监控啦!

starting weblogic with Java version:
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode)
Starting WLS with line:
/home/weblogic/bea/jdk160_05/bin/java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=48m  -XX:MaxPermSize=128m  -Xverify:none  -da -Dplatform.home=/home/weblogic/bea/wlserver_10.3 -Dwls.home=/home/weblogic/bea/wlserver_10.3/server -Dweblogic.home=/home/weblogic/bea/wlserver_10.3/server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole= -agentlib:jprofilerti=port=8849 -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar -Dweblogic.ext.dirs=/home/weblogic/bea/patch_wlw1030/profiles/default/sysext_manifest_classpath:/home/weblogic/bea/patch_wls1030/profiles/default/sysext_manifest_classpath:/home/weblogic/bea/patch_cie660/profiles/default/sysext_manifest_classpath -Dweblogic.Name=AdminServer -Djava.security.policy=/home/weblogic/bea/wlserver_10.3/server/lib/weblogic.policy   weblogic.Server
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 ...
JProfiler> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
JProfiler> Hotspot compiler enabled
JProfiler> Starting weblogic/Server ...

<Jun 25, 2010 12:09:21 PM EDT> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) Client VM Version 10.0-b19 from Sun Microsystems Inc.>


1.安装4.0版本,用这个注册码(s/n: A-G666#76114F-1olm9mv1i5uuly#0126)注册,不含括号。

2.卸载4.0,安装4.3.2版本,这次没有要求注册,运行测试例子,没有提示剩余使用时间(试用

版在使用时会提示剩余时间),注册成功。

不知道直接注册新版成不成,有兴趣可以试一试。

 


TAG:

 

评分:0

我来说两句

Open Toolbar