Brij Raj Kishore Brij Raj Kishore - 5 months ago 99
Linux Question

start-all.sh, start-dfs.sh command not found

I am using Ubuntu 16.04 LTS and installed hadoop 2.7.2. The Output of


hadoop version


is


Hadoop 2.7.2
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r b165c4fe8a74265c792ce23f546c64604acf0e41
Compiled by jenkins on 2016-01-26T00:08Z
Compiled with protoc 2.5.0
From source with checksum d0fda26633fa762bff87ec759ebe689c
This command was run using /usr/local/hadoop-2.7.2/share/hadoop/common/hadoop-common-2.7.2.jar


and when i run


whereis hadoop


it gives output as


hadoop: /usr/local/hadoop /usr/local/hadoop-2.7.2/bin/hadoop.cmd /usr/local/hadoop-2.7.2/bin/hadoop


But when i run command


start-all.sh


it says command not found.
also when i run


start-dfs.sh


it gives output as command not found.

I am able to run these command when i navigate to hadoop directory but i want to run these command without navigating into hadoop directory.

Answer

Your problem is that bash doesn't know where to look for ./start-all.sh.

You can fix this by opening $HOME/.bashrc and entering a line that looks like this:

PATH=$PATH:/usr/local/hadoop/sbin

This tells bash that it should look in '/usr/local/hadoop/sbin' for start-all.sh.