1. Modify the catalina.sh file in the Tomcat/bin directory
Java_opts= "$JAVA _opts-djava.rmi.server.hostname=${host_ip}
-dcom.sun.management.jmxremote.port=9999
-dcom.sun.management.jmxremote.ssl=false
-dcom.sun.management.jmxremote.authenticate=false "
Restart Tomcat. It is necessary to ensure that the added port is not occupied by other services. Method: NETSTAT-TLNP | grep 9999.
2. Open VISUALVM to add a new target host by remote. Right-click the added target host and add the JMX connection. Add 9999 to the.
Trouble Shoot the wrong line
If the connection does not occur. Check that the ports are open first.
Telnet HOST_IP 9999 will prompt connect refused if it is not open.
If not open. You need to edit iptables to open it.
/sbin/iptables-i input-p TCP--dport 8000-j ACCEPT #开启8000端口
/etc/rc.d/init.d/iptables Save #保存配置
/etc/rc.d/init.d/iptables Restart #重启服务
See if the port is open
Service Iptables Status
If it is not open, enter
/sbin/iptables-i input-p TCP--dport 9999-j ACCEPT #开启9999 TCP port
Service Iptables Save #保存配置
Service iptables Restart #重启服务
If the iptables is still invalid after editing. Iptables can be closed first
Service Iptables stop shutdown
Service Iptables Start
VISUALVM Adding remote management-centos