1.下载linux
https://www.ej-technologies.com/download/jprofiler/fileswindows
window使用window版本,linux上使用的TAR.GZ Archive (69 MB)版本。服务器
2.服务器端frontend
上传到服务器以后jvm
tar -zxvf jprofiler_linux_9_1_1.tar.gzdebug
修改/etc/profile系统配置文件:日志
JPROFILER_HOME=安装路径/jprofiler9/bin/linux-x64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JPROFILER_HOMEorm
使配置文件生效:source /etc/profilecdn
3.resin配置server
修改resin的配置信息conf/resin.xml
在<cluster>节点中添加
<class-loader>
<tree-loader path="安装路径/jprofiler9/lib"/>
<tree-loader path="安装路径/jprofiler9/bin"/>
</class-loader>
<server-default>
<jvm-arg>-agentpath:安装路径/jprofiler9/bin/linux-
x64/libjprofilerti.so=port=8849,nowait</jvm-arg>
</server-default>
上面说到的配置都是在64为的系统上配置的。若是是32位的,linux-x64应该改为linux-x86。
启动resin以后若是日志中出现
JProfiler> Protocol version 50
JProfiler> Using JVMTI
JProfiler> JVMTI version 1.1 detected.
JProfiler> Don't wait for frontend to connect.
JProfiler> 64-bit library
JProfiler> Starting up without initial configuration.
JProfiler> Listening on port: 8849.
JProfiler> Instrumenting native methods.
JProfiler> Can retransform classes.
JProfiler> Can retransform any class.
JProfiler> Native library initialized
JProfiler> VM initialized
说明配置成功,能够用windows上的客户端去链接了。
可是个人配置完了以后发现resin项目启动以后log的debug输出都没有了,只有info及以上级别的了,把resin的配置去掉以后就能够。还没搞明白怎么回事。 后面研究一下怎么利用jprofiler的信息来发现程序的一些问题。