VisualVm Monitor Remote Jvm

Use VisualVM to monitor the memory usage of the JVM and GC. The following code is used at the beginning:

java command
	-Djava.rmi.server.hostname=192.168.2.234
	-Dcom.sun.management.jmxremote
	-Dcom.sun.management.jmxremote.port=1099
	-Dcom.sun.management.jmxremote.authenticate=false
	-Dcom.sun.management.jmxremote.ssl=false

 

 There is no problem in the local area network. The local area network does not involve the problem of ports and firewalls, but the problem comes when you want to monitor the application of the remote cloud host. After writing it, you can't connect. After checking, JMXServer is exposed to the outside world. The interface is 1099. There is no problem. The problem is that VisualVm is connected to JMX through RMI Server. If the port of RMI is not configured, the port will be automatically generated, making this port uncontrollable. There must be a firewall in the cloud host. Then how to configure it, as follows:

java command
			-Djava.rmi.server.hostname=192.168.2.234
			-Dcom.sun.management.jmxremote
			-Dcom.sun.management.jmxremote.port=1099
			// if not set, RMI will choose random port
			-Dcom.sun.management.jmxremote.rmi.port=1099
			-Dcom.sun.management.jmxremote.authenticate=false
			-Dcom.sun.management.jmxremote.ssl=false
			-Dcom.sun.management.jmxremote.local.only=false

 The ports of RMI Connector and JMX Server are always, VisualVM can monitor the process

 

refer to:

     https://stackoverflow.com/questions/20884353/why-java-opens-3-ports-when-jmx-is-configured

     https://docs.oracle.com/javase/6/docs/api/javax/management/remote/rmi/package-summary.html

     http://blog.51cto.com/lizhenliang/1608005

Guess you like

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