Install Hive on Ubuntu


My configuration is Apache Hive 0.13.0 on machine with Ubuntu 14.04 and  Apache Hadoop 2.2.0

(About Hadoop installation –

Download and unpack Hive

Download latest Hive release from Apache web site

Unpack to /opt/hive folder. Change owner to Hadoop user and group, hduser and hadoop in my case

$ sudo chown -R hduser:hadoop /opt/hive

Configure environment variables 

Edit /etc/environment ( $ sudo nano /etc/environment)

add line
and also add /opt/hive/bin to the PATH variable
PATH="..some previous values...  :/opt/hive/bin"

Create folders in Hadoop file system

$ $HADOOP_HOME/bin/hadoop fs -mkdir /tmp
$ $HADOOP_HOME/bin/hadoop fs -mkdir /user/hive/warehouse
$ $HADOOP_HOME/bin/hadoop fs -chmod g+w /tmp
$ $HADOOP_HOME/bin/hadoop fs -chmod g+w /user/hive/warehouse

Run Hive, ensure installation

Hive CLI:

Enter as hadoop user and run Hive CLI: 

$ su hduser
$ hive

Try simple command to test:
> show tables;
Don’t forget semicolon after command 🙂 Press Ctrl+C to exit Hive

Starting HiveServer1

$ /opt/hive/bin/hive --service hiveserver

Starting HiveServer2

$ /opt/hive/bin/hiveserver2


One thought on “Install Hive on Ubuntu

  1. Nitya

    I am stuck with creating folders in HDFS.
    Getting the following error : WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
    and also while running hive,am getting folllowing error:
    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at org.apache.hadoop.util.RunJar.main(
    Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    … 3 more
    Please help me.


Leave a Reply

Your email address will not be published.