VisualVM Remote JVM

Tomcat configuration

  1. Enter TOMCAT_HOME/bin directory
  2. Open the catalina.sh file and add the following information:
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=192.168.0.237
                      -Dcom.sun.management.jmxremote.port=18999
                      -Dcom.sun.management.jmxremote.ssl=false
                      -Dcom.sun.management.jmxremote.authenticate=false" #Indicates no password
#If you need to configure the account password to log in, you can configure it as:
JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=192.168.0.237
                      -Dcom.sun.management.jmxremote.port=18999
                      -Dcom.sun.management.jmxremote.ssl=false
                      -Dcom.sun.management.jmxremote.password.file=jdk installation directory/jre/lib/management/jmxremote.password
                      -Dcom.sun.management.jmxremote.access.file=jdk_install_dir/jre/lib/management/jmxremote.access"

 

If you only monitor a running jar package, configure it as follows:

java -jar  -Djava.rmi.server.hostname=<ip> \
           -Dcom.sun.management.jmxremote.port=<port> \
           -Dcom.sun.management.jmxremote.ssl=false \
           -Dcom.sun.management.jmxremote.password.file=jdk_install_dir/jre/lib/management/jmxremote.password \
           -Dcom.sun.management.jmxremote.access.file=jdk_install_dir/jre/lib/management/jmxremote.access \
           bagtree-push-1.0.0-SNAPSHOT.jar

The VisualVM that comes with JDK1.6 is a good monitoring tool. This tool is jvisualvm.exe in the JAVA_HOME\bin\ directory.

Finally, close the firewall. The test is only for the set port, which cannot be connected (you can telnet, and other random ports may need to be opened), so all are open (in this case, account and password verification must be added)

Guess you like

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