1. Turn off the firewall:
/etc/init.d/iptables stop
2. Start the remote JSTATD
2.1 Configure Java Secure Access, save the following code as a file Jstatd.all.policy (name random), but put it in Java_home/bin, the content is as follows,
Grant CodeBase "file:${java.home}/. /lib/tools.jar "{permission java.security.AllPermission;};
2.2 Enter into Java_home/bin, save the following code as file startjstatd.sh, and give execute permission
chmod 777 startjstatd.sh
View the contents of the file as shown in: (The & symbol is run in the background, nohup is not affected by the window closing)
3, open the local JVISUALVM, right-click Remort, select "Add remort Host ...", enter your remote IP in the popup box, such as 192.168.0.23. Connection Successful
4. Close Tomcat:
Find Tomcat Process number
Ps-ef |grep Tomcat
Kill the Tomcat process
Kill-9 <pid Process Number >
5, download Jmx_remote.jar to the Tomcat folder in the Lib directory
Cd/usr/local/tomcat/lib/wget Http://apache.fayea.com/tomcat/tomcat-7/v7.0.61/bin/extras/catalina-jmx-remote.jar
6. Modify Tomcat Server.xml
Cd/usr/local/tomcat/confvi Server.xml
Add the following code to the Server.xml configuration file
<listener classname= "Org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiregistryportplatform= "12345" rmiserverportplatform= "12346"/>
7. Modify the catalina.sh file under Tomcat's Bin directory
Cd/usr/local/tomcat/binvi catalina.sh
Add the following code to the catalina.sh configuration file
Catalina_opts= "-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.authenticate=false- dcom.sun.management.jmxremote.ssl=false-djava.rmi.server.hostname=192.168.0.23 "
You can also add the following code within the startup.sh
8. Start Tomcat
./startup.sh
9, Win7 add jmx, port number 12345
JVISUALVM with JSTATD for remote monitoring +tomcat (view full version)