1. Installing OPENJDK
Centos:yum Install JAVA-1.8.0-OPENJDK Java-1.8.0-openjdk-devel
2.
# cd/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.31-1.b13.el6_6.x86_64/jre/lib/management/# CP Jmxremote.password.template jmxremote.password# chmod 644 jmxremote.password# VI jmxremote.passwordmonitorrole QED Controlrole
3.JSTATD Start with daemon process
# jstatd-j-djava.rmi.server.hostname=172.28.37.200 &[1] 8601# Could not create remote objectaccess denied ("Java.uti L.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)
Solve:
#cd/home/jdk-1.8/bin#vim jstatd.all.policy Grant codebase "file:${java.home}/. /lib/tools.jar "{permission java.security.AllPermission;};
#jstatd-j-djava.security.policy=jstatd.all.policy-j-djava.rmi.server.hostname=172.28.37.200 &
[1] 10008
4. Under Windows Java_home/bin, open the Jvisualvm.exe
, showing that the CPU is not supported by the JVM and needs to establish a JVM link
Under Tomcat, modify and add JVM parameters
# cd/root/apache-tomcat-8.0.17/bin# VI catalina.sh #找到JAVA_OPTS, added below, added location not required
java_opts= "$JAVA _opts-dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.port=9999 - Dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.ssl=false - djava.rmi.server.hostname=172.28.37.200 "#/startup.sh # NETSTAT-ANTP |grep 9999 #查看端口是否监听
Dubbo Service, modifying or adding JVM parameters
# Vim Service.sh
java_opts= "$JAVA _opts-dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.port=9999 - Dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.ssl=false - Djava.rmi.server.hostname=172.28.37.200 "
View Port monitoring after reboot
# NETSTAT-ANTP |grep 9999 #查看端口是否监听
CPU monitoring has occurred after reboot
Linux under Visualvmware JVM monitoring configuration