Tomcat – JMX connection to Tomcat running on Amazon EC2

amazon ec2javajmxtomcat

My Tomcat 7 process, which I run on a server on Amazon EC2, has settings such as these in CATALINA_OPTS which should allow me to connect for JMX monitoring remotely:

-Dcom.sun.management.jmxremote.port=8086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

However, connecting remotely does not work with either jconsole or jvisualvm. It just times out.

I've triple-checked that the EC2 security group allows access to the JMX remote port from my IP (and only from my IP).

Are there any settings missing?

Best Answer

Specify the java.rmi.server.hostname option too, so that it points to the public DNS name of your EC2 server:

-Djava.rmi.server.hostname=your.public.dns

That was sufficient to get it working for me, but for more tips, try this blog post:
JMX Monitoring on Amazon EC2

Related Topic