Let's suppose:
- Your Apache Tomcat 7 server is installed on Amazon EC2 platform
- You want to monitor Tomcat from your Mac OS computer (or Linux) without having installed jconsole on EC2
Then, do the following.
1) On the EC2 server side assign the CATALINA_OPTS variable (and export it):
$CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
2) Restarts Apache Tomcat
3) Start the ssh tunnel:
ssh -D9999 -i your_keyfile.pem ec2-user@your_domain_name.com
4) On the client side, open a terminal and execute the following:
jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=9999 service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi
That's it!!
PS. Remember to adjust it according the ports you want
For VisualVM, do not forget to configure the SOCKS proxy and pay attention to the option No Proxy Hosts in case of localhost
No hay comentarios.:
Publicar un comentario