To set up an SSH tunnel using local port forwarding in terminal
- Open a terminal window. On Mac OS X, choose Applications > Utilities > Terminal. On other Linux distributions, terminal is typically found at Applications > Accessories > Terminal.
- Type the following command to open an SSH tunnel on your local machine. This command accesses the ResourceManager web interface by forwarding traffic on local port 8157 (a randomly chosen, unused local port) to port 8088 on the master node's local web server. In the command, replace
~/mykeypair.pem
with the location and file name of your.pem
file and replaceec2-###-##-##-###.compute-1.amazonaws.com
with the master public DNS name of your cluster.ssh -i
~/mykeypair.pem
-N -L8157:ec2-###-##-##-###.compute-1.amazonaws.com
:8088 hadoop@ec2-###-##-##-###.compute-1.amazonaws.com
After you issue this command, the terminal remains open and does not return a response.Note -L
signifies the use of local port forwarding which allows you to specify a local port used to forward data to the identified remote port on the master node's local web server. - To open the ResourceManager web interface in your browser, type:
http://localhost:
in the address bar.8157
/ - When you are done working with the web interfaces on the master node, close the terminal windows.
from : https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-ssh-tunnel-local.html