Monitor JVM performance remotely

Question: Use jstatd+VisualVM to simply remotely monitor the JVM on the cloud host

 

   (1): Find the JDK installation location on the cloud host and enter the bin folder

root@iZwz92ia6b6a7m2g04wzneZ:/usr/lib/jvm/jdk1.8.0_111/bin#

   (2): Write a security policy file

root@iZwz92ia6b6a7m2g04wzneZ:/usr/lib/jvm/jdk1.8.0_111/bin# touch jstatd.all.policy

    The contents of the file are as follows:

grant codebase "file:/usr/lib/jvm/jdk1.8.0_111/lib/tools.jar" {
         permission java.security.AllPermission;
};

   Remember to give permission to this file.

  (3): Modify host

root@iZwz92ia6b6a7m2g04wzneZ:/usr/lib/jvm/jdk1.8.0_111/lib# vim /etc/hosts

    It can be seen that there is no real IP host in the hosts of the Alibaba Cloud host, so we cannot monitor it on the remote end.

    

    We need to add our real ip and our own machine name to this file

    
    save after modification

   (4) Start Jstatd

    Go back to the JDK bin folder and execute the startup command

nohup jstatd -J-Djava.security.policy=jstatd.all.policy -p 12099 &

   (5) Start monitoring

     Start the VisualVM that comes with jdk1.6 or above on the remote side, and add the remote host IP and port
     
       OK in the remote to easily monitor the JVM situation.

     
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326241502&siteId=291194637