剖析远程服务器还需要在 linux 的安装 yourkit profiler(以控制台行动不需要 License),把解压出来的 yjp-9.0.3-linux.tar.bz2 上传到服务器,如:/home/admin/yjp-9.0.3-linux.tar.bz2 1、在 linux 解压 yjp-9.0.3-linux.tar.bz2,并运行。
- cd /home/admin/
- tar xfj yjp-9.0.3-linux.tar.bz2
- cd yjp-9.0.3
- #生成启动脚本
- java -jar lib/yjp.jar -integrate
在生成启动脚本期间,要选择。如下:
- [admin@v022185 ~/yjp-9.0.3]$ java -jar lib/yjp.jar -integrate
- Choose server to integrate with:
- 1) Geronimo
- 2) JBoss 2.x/3.x/4.x
- 3) Jetty HTTP Server 5.x
- 4) JRun 4
- 5) Orion Application Server 1.5.x/2.x
- 6) Resin 2.x/3.x
- 7) Sun Application Server / GlassFish
- 8) Tomcat 3/4/5/6
- 9) WebLogic 9/10
- 10) WebSphere Application Server 7
- 11) Generic server (use if your server is not on the list)
- Enter number which corresponds to your server (0 to exit) and press Enter:
- >2
- Please specify whether the server runs on a 32-bit JVM or a 64-bit JVM.
- Hint: If you are not sure what to choose, choose "32-bit JVM". If with this choice the server does not start with profiling, re-run the integration and choose "64-bit Java" option.
- 1) 32-bit JVM
- 2) 64-bit JVM
- >2
- Location of JBoss startup script (<JBOSS_HOME>/bin/run.sh):
- >/home/admin/yjp-9.0.3/jboss_run.sh
- Startup options configuration: step 1 of 5
- Should option 'disablestacktelemetry' be specified?
- 1) Yes (recommended to minimize profiling overhead in production)
- 2) No
- >1
- Startup options configuration: step 2 of 5
- Should option 'disableexceptiontelemetry' be specified?
- 1) Yes (recommended to minimize profiling overhead in production)
- 2) No
- >1
- Startup options configuration: step 3 of 5
- Should option 'builtinprobes=none' be specified?
- 1) Yes (recommended to minimize profiling overhead in production)
- 2) No
- >1
- Startup options configuration: step 4 of 5
- Should option 'delay=10000' be specified?
- 1) Yes (recommended)
- 2) No
- >1
- Startup options configuration: step 5 of 5
- Please specify comma-separated list of additional startup options, or press Enter for no additional options:
- >
- Startup script to be used for profiling has been successfully created:
- /home/admin/yjp-9.0.3/jboss_run_with_yjp.sh
其实就在 jboss_run_with_yjp.sh 加个 jvm 启动参数:
- -agentpath:/home/admin/yjp-9.0.3/bin/linux-x86-64/libyjpagent.so=disablestacktelemetry,disableexceptiontelemetry,builtinprobes=none,delay=10000,sessionname=JBoss
可以参数自己的环境手动写,sessionname 是随便写吧(没验证过)。 用带 yjp 参数启动 jboss。就可以剖析远程服务器。 |