Connecting jconsole using SOCKS to Amazon EC2
Posted
by
freshfunk
on Server Fault
See other posts from Server Fault
or by freshfunk
Published on 2011-03-22T20:05:27Z
Indexed on
2013/11/03
10:00 UTC
Read the original article
Hit count: 329
I'm trying to use jconsole to view stats on an EC2 instance by using a socks proxy created by SSH. I've tried the various scripts mentioned in the links below but to no avail:
http://simplygenius.com/2010/08/jconsole-via-socks-ssh-tunnel.html
I'm running ssh -f -ND 8123 myuser@mymachine
and verified that at least Firefox goes through it as a proxy.
I then run
jconsole -J-DsocksProxyHost=localhost -J-DsocksProxyPort=8123 service:jmx:rmi:///jndi/rmi://ec2-XX-XX-XXX-XXX.compute-1.amazonaws.com:8080/jmxrmi
I run netstat -n on my EC2 instance and I see a connection created by my machine. However, the connection eventually disappears and I get a 'channel 2: open failed: connect failed: Operation timed out' from my ssh tunnel.
I've opened the jmx port through the security group and I've checked the port on the EC2 instance to make sure it's open (by telnet-ing to it).
I'm not sure where to look next. Are there some properties in sshd_config or ssh_config I need to enable for tunneling? Or anything in Mac OS X?
I feel like a serious noob but sys administration is really not my strong point. I've spent several hours and can't get this to work.
© Server Fault or respective owner