Reputation: 2327
I have installed and configured hadoop in a linux machine .Now i am trying to run a sample MR job.I have started the hadoop via the command /usr/local/hadoop/bin/start-all.sh and the output is
namenode running as process 7876. Stop it first.
localhost: datanode running as process 8083. Stop it first.
localhost: secondarynamenode running as process 8304. Stop it first.
jobtracker running as process 8398. Stop it first.
localhost: tasktracker running as process 8612. Stop it first.
so i think that my hadoop is configured successfully.But when i am tryinh to run below command it is giving
jeet@jeet-Vostro-2520:~$ hadoop fs -put gettysburg.txt /user/jeet/getty/gettysburg.txt
hadoop: command not found
i am new in hadoop.somebody please help .I am also posting the screenshot of what i am trying
Upvotes: 21
Views: 118665
Reputation: 1
Hadoop command not found?
put this 3 commands at the end of ~/.bashrc file sudo gedit ~/.bashrc
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export HADOOP_HOME=/home/Work/hadoop-1.2.1
export PATH=$HADOOP_HOME/bin:$PATH*
java-8-openjdk-amd64 - put your folder name
hadoop-1.2.1 - put your folder name
save the file and use below command source ~/.bashrc
or simply close the terminal and open it again
Upvotes: 0
Reputation: 77
Please make sure that you are logged into the particular user, whose .bashrc file has got this entry
export PATH=$PATH:/usr/local/hadoop/bin/
Assuming that your hadoop setup is lying at /usr/local
Example You have set the .bashrc file for user hadoopuser in /home/hadoopuser/.bashrc, then you should be logged in as hadoop user only and not as any other user.
Upvotes: 0
Reputation: 424
once echo your path ,if your path hasn't set ,then go to your .bashrc file
vi ~/.bashrc
and add folliwing in that.
export PATH=$PATH:/usr/local/hadoop/bin/
Upvotes: 0
Reputation: 173
I got the same error, and this worked for me
I configured path variable in.bashrc.
export HADOOP_HOME=/opt/hadoop
export PATH= $PATH:$HADOOP_HOME/bin
Sometime restarting your machine can resolve the issue ,only if you have configured everything correct.
Upvotes: 3
Reputation: 174
cd ~
vi .bashrc
export PATH=$PATH:<hadoop installation path>
for example replace <hadoop installation path>
by /usr/local/hadoop/bin/
Upvotes: 2
Reputation: 4197
As it seems from your commands history, you can replace hadoop
by /usr/local/hadoop/bin/hadoop
and it should help.
If you want to use hadoop
command without specifying the full path to it, you can edit ~/.bashrc
file and add the following line:
export PATH=$PATH:/usr/local/hadoop/bin/
Then you need to reopen your terminal.
Upvotes: 43
Reputation: 240900
edit PATH
variable, if you want to be able to invoke hadoop without specifying full path
export PATH=$PATH:/usr/local/hadoop/bin/
if you want it for each bash profile then edit ~/.bash_profile
to include this
Upvotes: 7