3

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

http://gabrielcain.com/blog/2010/11/02/using-ssh-proxying-to-connect-jconsole-to-remote-cassandra-instances/

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.

freshfunk
  • 155
  • 6

1 Answers1

0

On your Cassandra (v0.8.5) node, look for the following lines in $CASSANDRA_HOME/bin/conf/cassandra-env.sh:

# add this if you're having trouble connecting:
JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=<public name>"

Ensure that the second line is uncommented and set to the public DNS name of your ec2 instance.