在目标远程节点启动jstatd:
如果出现如下错误,可使用下面的 jstatd.sh 来启动
[apache@indigo ~]$ jstatd
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:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.System.setProperty(System.java:725)
at sun.tools.jstatd.Jstatd.main(Jstatd.java:122)
[apache@indigo ~]$ cat jstatd.sh
#!/bin/sh
policy=${HOME}/.jstatd.all.policy
[ -r ${policy} ] || cat >${policy} <<'POLICY'
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
POLICY
jstatd -J-Djava.security.policy=${policy} &
[apache@indigo ~]$
启动VisualVM后,只需指定目标节点IP即可,效果如下:
参考:
http://stackoverflow.com/questions/9939883/can-not-start-jstatd-in-linux