0

I am trying to forward the remote(ec2) port to local port to watch the jobtracker in my local browser which is running on amazon ec2 cluster. But unable to forward the remote port.

Here is my code:

Net::SSH.start('ec2-23-23-4-229.compute-1.amazonaws.com' ,'hadoop' ,:keys =>"mykeypair.pem",:forward_agent => true) do |ssh|  
    ssh.forward.remote(9033, "localhost",9101,"ec2-23-22-4-249.compute-1.amazonaws.com")  
    ssh.loop { !ssh.forward.active_remotes.include?([9033, "localhost"]) }  
end
philant
  • 34,748
  • 11
  • 69
  • 112
Manohar
  • 1
  • 3
  • This doesn't answer directly your question, but might help. What I've done to view the jobtrackers webpage was connecting to it via ssh with -D option (socks proxy): ssh -i ec2key root@ec2instance -D20000. Then I configured socks proxy in my browser (localhost:20000) and could connect to the NameNode/JobTracker web pages via their private IPs. – facha Jan 16 '14 at 15:24
  • Found the solution. It might help someone: ssh=Net::SSH.start(dns, 'hadoop' ,:keys => ["src/#{$parameters_hash['pem_file_name']}"],:forward_agent => true) ssh.forward.local(port_available, 'localhost', 9100) – Manohar Apr 25 '14 at 14:01

1 Answers1

0

According to the original poster:

Found the solution. It might help someone:

ssh=Net::SSH.start(dns, 'hadoop' ,:keys => ["src/#{$parameters_hash['pem_file_name']}"],:forward_agent => true) 
ssh.forward.local(port_available, 'localhost', 9100)
Kenster
  • 23,465
  • 21
  • 80
  • 106