简体   繁体   中英

remote profiling neo4j using visualvm

I am trying to monitor GC information using VisualVM from local laptop and connecting to Neo4j (enterprise) application running on Oracle JDK 8 on remote EC2 instance running ubuntu 16. I am able to connect using JMX connection but the issue is I can't view anything on VisualGC (plugin). The message is "Not supported for this JVM".

Based on this link and link , I ran the jstatd command on the remote but that didn't solve the problem. Next, looked at this link , I ran jstatd as neo4j user as this is the user under which Neo4j service runs. If I run jstatd as ubuntu user, the below command works but doesn't show any data on VisualGC.

sudo -u neo4j jstatd -p 8888 -J-Djava.security.policy=/home/ubuntu/tools.policy -J-Djava.rmi.server.hostname=neo4j_ip_address

Running above command as neo4j user gave this error:

Could not create remote object access denied ("java.util.PropertyPermission" "java.rmi.server.ignoreSubClasses" "write") java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.rmi.server.ignoreSubClasses" "write")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at java.security.AccessController.checkPermission(AccessController.java:884)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.System.setProperty(System.java:792)
        at sun.tools.jstatd.Jstatd.main(Jstatd.java:139)

Are these the correct permissions for tools.policy file?

-rwxr-xr-x 1 neo4j  adm    112 Mar 21 15:41 tools.policy

Contents of tools.policy:

grant codebase "file:/usr/lib/jvm/java-8-oracle/lib/tools.jar" {
   permission java.security.AllPermission;
};

How do I get the VisualGC to work in this scenario? Are there any logs for VisualVM to know what's going on? Any other tools that I can use to visually see GC statistics? Any help is much appreciated. Thanks.

如果您尝试使用完整路径运行jstatd会发生什么?

sudo -u neo4j /usr/lib/jvm/java-8-oracle/bin/jstatd -p 8888 -J-Djava.security.policy=/home/ubuntu/tools.policy -J-Djava.rmi.server.hostname=neo4j_ip_address

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM