2011. augusztus 10., szerda

Tomcat remote JMX console

Recently I had to create a remote JMX console to debug an issue running on a production server. It went more or less flawlessly. Here is how to do it:

1. Start tomcat using the following command:

CATALINA_OPTS='-Dcom.sun.management.jmxremote.port=9533 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=x.x.x.x' ./catalina.sh run

(Note: replace x.x.x.x by the ip address of your server)

2. Open up 9533 and the RMI port (see netstat -pa) using iptables.

Note that the above command does not set up authentication, so do this only on an intranet.