Time for action – installing Hive
Let's now set up Hive so we can start using it in action.
Download the latest stable version of Hive and move it to the location to which you wish to have it installed:
$ mv hive-0.8.1.tar.gz /usr/local
Uncompress the package:
$ tar –xzf hive-0.8.1.tar.gz
Set the
HIVE_HOME
variable to the installation directory:$ export HIVE_HOME=/usr/local/hive
Add the Hive home directory to the path variable:
$ export PATH=${HIVE_HOME}/bin:${PATH}
Create directories required by Hive on HDFS:
$ hadoop fs -mkdir /tmp $ hadoop fs -mkdir /user/hive/warehouse
Make both of these directories group writeable:
$ hadoop fs -chmod g+w /tmp $ hadoop fs -chmod g+w /user/hive/warehouse
Try to start Hive:
$ hive
You will receive the following response:
Logging initialized using configuration in jar:file:/opt/hive-0.8.1/lib/hive-common-0.8.1.jar!/hive-log4j.properties Hive history file=/tmp/hadoop/hive_job_log_hadoop_201203031500_480385673.txt hive>
Exit the Hive interactive shell...