Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

migrated from superuser.com Feb 6 '12 at 16:29

This question came from our site for computer enthusiasts and power users.

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.