2
votes

I downloaded the latest Hive release 0.7.1.

Cannot find hadoop installation: $HADOOP_HOME must be set or hadoop must be in the path

I went into this directory /home/hadoop/hive-0.7.1-bin/bin and tried running the Hive Shell.

./hive shell But I am getting the above error in the CLI.

I tried setting the path: $HADOOP_HOME=home/hadoop/hadoop/bin

I am using Hadoop 0.20.2

5

5 Answers

5
votes

As per the link : http://wiki.apache.org/hadoop/GettingStartedWithHadoop

Hadoop home is HADOOP_HOME is the parent directory of the bin directory that holds the Hadoop scripts.

Also the following $HADOOP_HOME=home/hadoop/hadoop/bin seems to be a relative path. It is better to give the full path from root.

2
votes

In addition to your path not being absolute, the syntax is wrong. Use HADOOP_HOME= not $HADOOP_HOME=

0
votes

You should setup environmental variable to your operating system, also hadoop home path should be "hadoop_0.20.2" directory not "bin".

For example in Ubuntu

export HADOOP_HOME="/path/to/hadoop/"

to check :

echo $HADOOP_HOME
0
votes

You are going to want to set this for each time you log on.

First you have to determine your path to hadoop/bin

From your post my guess is it might be

/home/hadoop/hadoop/bin

Now you can do

EXPORT HADOOP_HOME=/home/hadoop/hadoop/bin

but this would need to be done every time you log on and off.

So I recommend going and adding this file to your profile folder. Usually found in /etc/profile. So try

sudo vi /etc/profile

and add the following line right on the top.

EXPORT HADOOP_HOME=/home/hadoop/hadoop/bin 

Save and quit

:wq

And then run the following commmand to update your variables

source /etc/profile

To confirm it works try the following. Notice when using echo you use $ but when assigning the variable you do not.

echo $HADOOP_HOME
0
votes

Sample: export HADOOP_HOME=/usr/local/hadoop