Support Questions

Find answers, ask questions, and share your expertise

-bash: hadoop: command not found - HDP 2.5 Sandbox on Azure

avatar

I've managed to install the HDP 2.5 Sandbox on Azure following your tutorial (https://hortonworks.com/tutorial/sandbox-deployment-and-install-guide/section/4/). I can successfully log in into the Sandbox via SSH through PuTTY and can also log into Ambari through the web browser.

However, I can't execute the command "hadoop fs -ls" in the SSH console, as it returns with the error message "-bash: hadoop: command not found". I executed the commands "which hadoop" and "which hdfs" but neither are found.

In Ambari, HDFS is running. I have not done any configuration of the Sandbox or anything that may have affected the installation of the Sandbox. The Sandbox was installed directly from the Azure marketplace.

1 ACCEPTED SOLUTION

avatar

I've figured out the problem, and for those of you having a similar issue to myself, the way around it is that you're most probably trying to execute these type of commands through your SSH client (e.g. PuTTY). Confusingly, this isn't where you access your Sandbox from (which the tutorial isn't very clear about), this only SSHs into the VM running the Sandbox. In other words, you're only on the VM, not the Sandbox.

To access the Sandbox via a Shell, you need to first, as usual, SSH into your VM's public IP address (obtained from Azure), then open your web browser and navigate to 127.0.0.1:4200 (you may need to configure this port as one of your SSH tunnels). This would bring up a web-browser based Shell which is directly accessing the Sandbox. Log in using username root/password hadoop and here you'll be able to execute hadoop and other service based commands (e.g. ambari-server commands, ambari-agent commands etc.).

There is no need to reconfigure SSH ports on either Azure or on the VM's OS to listen to 2222 instead of 22, which I've seen suggested in other similar topics. Follow the Sandbox's set up tutorial (https://hortonworks.com/tutorial/sandbox-deployment-and-install-guide/section/4/), and then follow the above paragraph to access the Sandbox's Shell to be able to execute hadoop based commands.

View solution in original post

2 REPLIES 2

avatar

I've figured out the problem, and for those of you having a similar issue to myself, the way around it is that you're most probably trying to execute these type of commands through your SSH client (e.g. PuTTY). Confusingly, this isn't where you access your Sandbox from (which the tutorial isn't very clear about), this only SSHs into the VM running the Sandbox. In other words, you're only on the VM, not the Sandbox.

To access the Sandbox via a Shell, you need to first, as usual, SSH into your VM's public IP address (obtained from Azure), then open your web browser and navigate to 127.0.0.1:4200 (you may need to configure this port as one of your SSH tunnels). This would bring up a web-browser based Shell which is directly accessing the Sandbox. Log in using username root/password hadoop and here you'll be able to execute hadoop and other service based commands (e.g. ambari-server commands, ambari-agent commands etc.).

There is no need to reconfigure SSH ports on either Azure or on the VM's OS to listen to 2222 instead of 22, which I've seen suggested in other similar topics. Follow the Sandbox's set up tutorial (https://hortonworks.com/tutorial/sandbox-deployment-and-install-guide/section/4/), and then follow the above paragraph to access the Sandbox's Shell to be able to execute hadoop based commands.

avatar
New Contributor

Thanks !!!