Reputation: 8155
I am trying to check my installation of hadoop. I did create the environment variables and when I call printenv
, I do see my HADOOP_HOME and PATH variables printed and correct (home/hadoop and HADOOP_HOME/bin respectively).
If I go to home/hadoop in the terminal and call ls
, I see the hadoop file there. If I try to run it by calling hadoop
, it still tells me command not found.
First day on Linux, so there may be a stupid answer to this problem.
Upvotes: 3
Views: 19216
Reputation: 81
You must run “hadoop version
” command.
If the hadoop setup is fine, then you should see the following result:
Hadoop 2.4.1
Subversion https://svn.apache.org/repos/asf/hadoop/common -r 1529768
Compiled by hortonmu on 2013-10-07T06:28Z
Compiled with protoc 2.5.0
From source with checksum 79e53ce7994d1628b240f09af91e1af4
For installation related guide you can refer here:
Link to my quora answer https://qr.ae/TWngHN
Hope this helps.
Thanks
Upvotes: 1
Reputation: 494
You may be editing the wrong ~/.bashrc file.
Open terminal and run sudo gedit ~/.bashrc
and edit these command
export HADOOP_HOME=/usr/local/hadoop
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin
Note: You must not use sudo gedit ~/.bashrc.sh
these both work differently on newer OS
Upvotes: 0
Reputation: 529
Enter which hadoop
in your terminal. If you see a path as an output, hadoop is set in PATH of your system. If you get something similar to this,
usr/bin/which: no hadoop in (/usr/local/hadoop....
you might not have setup everything properly. Modify the /etc/bash.bashrc
with
export HADOOP_HOME = /path/to/hadoop/folder
and add it to PATH using export PATH=$PATH:HADOOP_HOME/bin
Upvotes: 0
Reputation: 11
Upvotes: 1
Reputation: 2574
HOME DIRECTORY:
/home/hadoop is a home directory created by linux similar to Document and settings
in windows.
Open your terminal and type:
ls -l /home/hadoop
Post your result for this command: ls -l /home/hadoop
SETTING GLOBAL PATH:
Go to /home/hadoop
and open .bashrc
in text editor.
Add these lines at the end:
export HADOOP_HOME=/path/to/your/hadoop/installation/folder
export PATH=$PATH:$HADOOP_HOME/bin
Save and exit. Now type, this in your teminal:
echo $PATH
echo $HADOOP_HOME
If these commands shows correct directories, try hadoop
command. It should work.
Post your result for these command: echo $PATH and echo $HADOOP_HOME
Upvotes: 5
Reputation: 13394
Your current working directory is probably not part of your path. That is default on linux systems.
If you are in the same directory, where your hadoop
file is, run that command with an relative path, like: ./hadoop
Upvotes: 5