文章出處

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即可

 

 

第一行是連接成功

第二行和第三行是斷開

第四行是重新連接


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()