15 Ağustos 2018 Çarşamba

Remote Application Profiling With jstatd and Jvisualvm

In order to attach remote java application with profiling tool you can follow these steps:

1) Login to remote server
2) create jstatd.all.policy file as:

grant codebase "file:/opt/jdk1.7.0_80/lib/tools.jar" {
   permission java.security.AllPermission;
};

where /opt/jdk1.7.0_80 is your java home or you use "file:${java.home}/lib/tools.jar"  if your environment parameters has been set.


3) start your jstatd process :
 /opt/jdk1.7.0_80/bin/jstatd -J-Djava.security.policy=/absolute-path-to-policy/jstatd.all.policy -p 12535 


I encountered problems with default jstatd port 1099, therefore i have set custom port as 12535
Again /opt/jdk1.7.0_80 is your java home or you use jstatd directly if jstatd executable is in your executable classpath.

4) Start JVisualVM bundled with JDK on you computer.
5) Right click to remote. Enter remote computer ip address.


6) Select host ip address. Again right click, and select add jstatd connection.
7) Now fill port address given to jstatd process at step 3.




7) Now you can see java processes running on server.

For more information read:

https://nljug.org/nieuws/blog-profiling-remote-jvm-using-visualvm/
http://mriddle.com/2011/06/30/Monitoring-Remote-Java-Applications-with-VisualVM.html


Hiç yorum yok:

Yorum Gönder