2011-04-15 32 views
2

我試圖讓JProfiler的一個簡單的本地主機會話啓動並運行。我創建了會話,主機是127.0.0.1,端口是默認的8849,並且我已經將啓動/關閉命令指向我的本地tomcat安裝startup.sh/shutdown.sh。我點擊確定,我得到「連接到127.0.0.1:8849」,並在150秒後(我修改了超時)超時並說:簡單的Jprofiler安裝程序不起作用

無法連接到127.0.0.1:8849。請確保遠程地址正確,遠程程序正常啓動,並且網絡路由允許套接字連接。

地址不可能是錯的,我已經驗證(PS英法| grep的Tomcat)的這個過程是了,還檢查tomcat的日誌,它的等待請求:

INFO: Starting Coyote HTTP/1.1 on http-8080 
Apr 15, 2011 7:49:13 AM org.apache.jk.common.ChannelSocket init 
INFO: JK: ajp13 listening on /0.0.0.0:8009 
Apr 15, 2011 7:49:13 AM org.apache.jk.server.JkMain start 
INFO: Jk running ID=0 time=0/21 config=null 
Apr 15, 2011 7:49:13 AM org.apache.catalina.startup.Catalina start 
INFO: Server startup in 47312 ms 

有什麼我需要做的打開端口?例如,我是否應該修改傳遞給tomcat的JAVA_OPTS?

回答

4

是的。 你需要像這樣(爲OS X)

export JAVA_OPTS="-agentlib:jprofilerti=port=8849 \ 
    -Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar" 

export DYLD_LIBRARY_PATH=/Applications/jprofiler5/bin/macos 

通常當你通過JProfiler的嚮導配置一個新的會話,它會告訴你,你需要把這些確切參數。

對於我這個嚮導是StartCenter - > New Session,然後選擇「新的遠程集成」。 然後會詢問本地/遠程,啓動模式,jvm類型,性能分析端口,並在第6頁上顯示「執行所需的修改」並列出它們。

或者,您可以從菜單欄中選擇「集成嚮導」。

+0

hm ...新會話嚮導在哪裏?我剛剛進入菜單上的Session/New Session。 – Kevin 2011-04-15 15:15:30

1

步驟1:在從/root目錄Linux機器上打開.bash_profile文件。在enter code here .bash_profile文件中

export LD_LIBRARY_PATH=/dsvol/jprofiler6/bin/linux-x86 

步驟2 輸入jprofiller位置(使用下面的命令出口):走進Tomcat的安裝目錄。從bin文件夾 打開catalina.sh文件中catalina.sh文件(僅限於紅色信息和黑色的顏色,您可以在默認情況下catalina.sh文件中找到)

export JPROFILER_HOME 
JAVA_OPTS="-Xms768m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF8 -agentpath:/opt/Performance/jprofiler7/bin/linux-x86/libjprofilerti.so=port=8849 $CATALINA_OPTS" 

步驟3進入詳情如下:由開始從bin文件夾服務器執行starup.sh命令

1

配置將遵循在此所說明的JProfiler通過提供的嚮導最簡單的方法,也有非GUI嚮導,這是非常方便的:

http://resources.ej-technologies.com/jprofiler/help/doc/indexRedirect.html?http&&&resources.ej-technologies.com/jprofiler/help/doc/sessions/remote.html

例如對於Tomcat,以下是自動插入Tomcat的啓動。sh腳本,這意味着你不必猜測:


# The following lines have been added by the 
# application server integration wizard of JProfiler 

CATALINA_OPTS="-agentpath:/local/jprofiler8/bin/linux-x64/libjprofilerti.so=port=8849,nowait $CATALINA_OPTS" 
export CATALINA_OPTS 

# end of modifications 

exec "$PRGDIR"/"$EXECUTABLE" run "[email protected]" 

好運

-1

這是爲我工作,JProfiler的9.1.1; OSX 10.11.3