我想在ubuntu上配置一個運行tomcat7的遠程服務器。我已經閱讀了多個教程,但無法運行它。遠程服務器JProfiler:幫助在步驟指南集成遠程服務器上的jprofiler ubuntu
首先我上
JProfiler的一體化遠程系統上下載jprofiler9和提取。
wget http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.tar.gz
tar -xzf jprofiler_linux_9_2.tar.gz
就跑以下命令
jprofiler9/bin# ./jpintegrate
它問我一些信息,並生成2個文件
- startup-jp.sh這個文件我想從
startup.sh
創建,如上面的嚮導要求我提供啓動腳本的路徑(/usr/share/tomcat7/bin/startup.sh),以便在同一個文件夾中創建新文件。 - 配置,jp.xml同樣嚮導要求我輸入一些指令的配置文件的名稱:可以在 JProfiler的GUI進口快速連接到應用服務器
的變更內容是startup-jp.sh如下
# The following lines have been added by the
# application server integration wizard of JProfiler
CATALINA_OPTS="-agentpath:/home/ubuntu/jprofiler9/bin/linux-x64/libjprofilerti.so=port=8383 $CATALINA_OPTS"
export CATALINA_OPTS
# end of modifications
exec "$PRGDIR"/"$EXECUTABLE" run "[email protected]"
Statring的JProfiler 這裏我很困惑如何運行的JProfiler,我想運行startup-jp.sh開始日Ë探查
它運行startup-jp.sh
後控制檯登錄成功,但是當我從我的本地系統的JProfiler GUI連接到該遠程服務器,服務器genrates沒有發現關於路徑一些錯誤這裏運行
root# /usr/share/tomcat7/bin/startup.sh
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /usr/share/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
JProfiler> Protocol version 55
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> 64-bit library
JProfiler> Listening on port: 8383.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
JProfiler> Waiting for a connection from the JProfiler GUI ...
JProfiler> Using dynamic instrumentation
JProfiler> Time measurement: elapsed time
JProfiler> CPU profiling enabled
Oct 28, 2016 4:27:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Oct 28, 2016 4:27:31 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat7/temp
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat7/conf/server.xml]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.Catalina initDirs
SEVERE: Cannot find specified temporary folder at /usr/share/tomcat7/temp
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/share/tomcat7/conf/server.xml]
Oct 28, 2016 4:27:32 AM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.
JProfiler> Keeping VM alive until frontend disconnects.
顯然它無法看到所需的不同目錄(怪),請注意,我從來沒有遇到startup.sh開始我tomcat7但使用service tomcat7 start
,可能是這裏的問題。這裏是我的tomcat7目錄結構
在/ usr /共享/ tomcat7/
drwxr-xr-x 2 root root 4.0K Oct 28 04:21 bin
-rw-r--r-- 1 root root 39 Feb 21 2014 defaults.md5sum
-rw-r--r-- 1 root root 2.0K Feb 21 2014 defaults.template
drwxr-xr-x 2 root root 4.0K Oct 10 06:06 lib
-rw-r--r-- 1 root root 53 Feb 21 2014 logrotate.md5sum
-rw-r--r-- 1 root root 118 Feb 21 2014 logrotate.template
的/ var/lib中/ tomcat7/
drwxr-xr-x 3 tomcat7 tomcat7 4.0K Apr 21 2016 common
lrwxrwxrwx 1 root root 12 Jun 19 2015 conf -> /etc/tomcat7
lrwxrwxrwx 1 root root 17 Jun 19 2015 logs -> ../../log/tomcat7
drwxr-xr-x 3 tomcat7 tomcat7 4.0K Apr 21 2016 server
drwxr-xr-x 3 tomcat7 tomcat7 4.0K Apr 21 2016 shared
drwxrwxr-x 6 tomcat7 tomcat7 4.0K Oct 27 06:10 webapps
lrwxrwxrwx 1 root root 19 Jun 19 2015 work -> ../../cache/tomcat7
通過增加固定例外以上在啓動-JP中的以下行。SH
export CATALINA_BASE="/var/lib/tomcat7/"
現在能夠找到丟失的文件夾
新問題
現在的問題是我的本地JProfiler的GUI正在採取太多的時間(例如,如果我重新啓動腳本,它捕獲很少的條目,但不久後
tomcat的CPU使用率爲197.5%,受頂級命令的支配
因此沒有其他東西被本地jprofiler GUI加載。我無法找出造成這麼多CPU使用率的原因。
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5496 tomcat 38 18 3005m 675m 17m S 197.5 9.0 21:09.55 java
對於這個新的問題,請與我聯繫[email protected] –