Not able to Connect a Remote Host to the VisualVM

后端 未结 5 1564
执念已碎
执念已碎 2021-01-31 18:59

I am new to Java and I\'m facing a problem in connecting a Remote Host to the JVisualVM.

I\'ve searched the Internet and followed all the steps mentioned th

5条回答
  •  庸人自扰
    2021-01-31 19:43

    Start jstatd in nohup on the server which needs to be monitored and connect VisualVM to the jstatd port, following below steps:

    Step 1 : Create start-jstatd.sh and copy the below content:

    nohup jstatd -p 1099 -J-Djava.security.policy=<(echo 'grant codebase "file:${java.home}/../lib/tools.jar" {permission java.security.AllPermission;};') &
    

    Step 2: Give executable permission to the file:

    $ chmod a+rwx start-jstatd.sh
    

    Step 3: Start jstatd:

    $ sh start-jstatd.sh
    

    Step 4: Add Remote Host in VisualVM:

    Step 5: Add JMX Connection to the Remote Host, as shown in the below image and Click OK button:

提交回复
热议问题