最近做性能测试,使用jprofiler。为了监控远程jar也是一顿折腾。
记录下来给自己备份,也给其他同学一个参考。
1.首先去jrofiler官网下载,本地客户端和linux的jprofiler。切记本地和linux的jprofiler要保持一致。
2.启动远程jar包
java -Xmx3g -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=host地址 -jar 自己的.jar > cms-service.log 2>&1 & -Xbootclasspath/a:/opt/jprofiler9/bin/agent.jar
3.启动linux中的/opt/jprofiler9/bin/jenbale


5.设置本地的jprofiler
1)打开session,选择快速连接

2)选择远程服务

3)编辑远程连接ip和端口。端口选择8849

总结:
点击open输入密码就可以连接远程了
网友评论