Issues with installing Hive on Ubuntu: $HADOOP_HOME or $HADOOP_PREFIX must be set or hadoop must be in the

10,373

Solution 1

You need to add HADOOP_HOME in hive-config.sh file.

user@ubuntu:~$ cd  /usr/local/hive/bin
user@ubuntu:~$ sudo gedit hive-config.sh

Go to the line where following statements are written in file:

HIVE_CONF_DIR="${HIVE_CONF_DIR:-$HIVE_HOME/conf"
export HIVE_CONF_DIR=$HIVE_CONF_DIR
export HIVE_AUX_JARS_PATH=$HIVE_AUX_JARS_PATH

Below this write the following

export HADOOP_HOME=/usr/local/hadoop-2.7.1 

Solution 2

Need to setup correct HADOOP_HOME on conf/hive-env.sh file as mentioned below

# Set HADOOP_HOME to point to a specific hadoop install directory
 HADOOP_HOME={your hadoop home location}
#e.g. as below
 HADOOP_HOME=/opt/hadoop-2.6.0
Share:
10,373
Maeve90
Author by

Maeve90

Updated on June 26, 2022

Comments

  • Maeve90
    Maeve90 almost 2 years

    I have installed Hadoop on my Ubuntu EC2 instance and have gone through all the steps for installing hive following this tutorial: http://www.tutorialspoint.com/hive/hive_installation.htm

    However, when I go to launch hive I get the following error message:

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

    My bashrc file reads this:

    export JAVA_HOME=/usr
    export PATH=$PATH:$JAVA_HOME/bin
    export HADOOP_HOME=/usr/local/hadoop-2.7.1
    export PATH=$PATH:$HADOOP_HOME/bin/
    
    
    export HADOOP_MAPRED_HOME=$HADOOP_HOME
    export HADOOP_COMMON_HOME=$HADOOP_HOME
    export HADOOP_HDFS_HOME=$HADOOP_HOME
    export YARN_HOME=$HADOOP_HOME
    export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
    export PATH=$PATH:$HADOOP_HOME/sbin:$HADOOP_HOME/bin
    
    
    export HIVE_HOME=/usr/local/hive
    export PATH=$PATH:$HIVE_HOME/bin
    export CLASSPATH=$CLASSPATH:/usr/local/hadoop-2.7.1/lib/*:.
    export CLASSPATH=$CLASSPATH:/usr/local/hive/lib/*:.
    
    export DERBY_HOME=/usr/local/derby
    export PATH=$PATH:$DERBY_HOME/bin
    

    Does anyone have any suggestions on how to fix this? I presume it's an issue with how I have linked my Hadoop and hive,

    Thanks in advance,

    Maeve

  • Maeve90
    Maeve90 about 8 years
    ah yes, the path was wrong in that file! thanks very much