Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

linux

hadoop

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.

like image 533
Brij Raj Kishore Avatar asked Jun 25 '16 16:06

Brij Raj Kishore


People also ask

Where is start all sh?

start-all.sh and stop-all.sh are located in sbin directory while hadoop binary file is located in bin directory.


1 Answers

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

You can fix this by opening $HOME/.bashrc and adding 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.

Note:

Changes to $HOME/.bashrc will not take affect in any terminals that are currently open.

If you need the changes to take affect in a terminal that is currently open, run

source $HOME/.bashrc
like image 53
J. Allan Avatar answered Oct 12 '22 23:10

J. Allan