Steps to Install Hive Using Manual Steps
Prerequisites
Make sure the environment variable JAVA_HOME
is set correctly.
Example:
# export JAVA_HOME=/usr/lib/jvm/java-7-sun
You can set these system variables by using the shell command line or by updating files
such as /etc/profile
or ~/.bash_profile
. See the Linux
documentation for more details about setting system environment variables.
About this task
root
or using
sudo
.Procedure
-
Update the repository cache on all nodes:
- On RedHat/CentOS
# yum clean all
- On SUSE
# zypper refresh
- On Ubuntu
# apt-get update
-
On each planned Hive node, install Hive packages.
- To install the latest suppported version of Hive:
On CentOS / RedHat yum install mapr-hive
On SUSE zypper install mapr-hive
On Ubuntu apt-get install mapr-hive
- To install the latest suppported version of Hive and HiveServer2:
On CentOS / RedHat yum install mapr-hive mapr-hiveserver2
On SUSE zypper install mapr-hive mapr-hiveserver2
On Ubuntu apt-get install mapr-hive mapr-hiveserver2
- To install the latest suppported version of Hive, HiveServer2, and
HiveMetastore:
On CentOS / RedHat yum install mapr-hive mapr-hiveserver2 mapr-hivemetastore
On SUSE zypper install mapr-hive mapr-hiveserver2 mapr-hivemetastore
On Ubuntu apt-get install mapr-hive mapr-hiveserver2 mapr-hivemetastore
NOTE: If you are using an embedded hive metastore, do not installmapr-hiveserver2
andmapr-hivemetastore
on the same node asmapr-hive
. This configuration results in a java run-time exception when you attempt to start the hive CLI. - To install the latest suppported version of Hive, HiveServer2, HiveMetastore
and WebHCat:
On CentOS / RedHat yum install mapr-hive mapr-hiveserver2 mapr-hivemetastore mapr-hivewebhcat
On SUSE zypper install mapr-hive mapr-hiveserver2 mapr-hivemetastore mapr-hivewebhcat
On Ubuntu apt-get install mapr-hive mapr-hiveserver2 mapr-hivemetastore mapr-hivewebhcat
NOTE: If you are using an embedded hive metastore, do not installmapr-hiveserver2
andmapr-hivemetastore
on the same node asmapr-hive
. This configuration results in a java run-time exception when you attempt to start the hive CLI. - To install an earlier version, specify the version in the package name.
On RedHat/CentOS Determine the available versions with the following command:
Then, you can run the following command to install a specific package:yum list --showduplicates mapr-hive
yum install mapr-hive-<version>
On Ubuntu Determine the available versions with the following command:
Then, you can run the following command to install a specific package:apt-cache madison mapr-hive
apt-get install mapr-hive=<version>
- To install the latest suppported version of Hive:
-
Run
configure.sh
:/opt/mapr/server/configure.sh -R
-
Set the following environment variables:
HIVE_HOME
should be set to the Hive installation directory. export HIVE_HOME=/opt/mapr/hive/hive-<version>export HIVE_HOME=/opt/mapr/hive/hive-<version>
- PATH should include $HIVE_HOME/bin. export
PATH=$PATH:$HIVE_HOME/bin
export PATH=$PATH:$HIVE_HOME/bin
You can set these system variables by using the shell command line or by updating files such as
/etc/profile
or~/.bash_profile
. See the Linux documentation for more details about setting system environment variables.
Results
/opt/mapr/hive/hive-<version>/bin/hive
What to do next
Before running Hive queries with HiveServer2, you must perform one of the following tasks otherwise queries will fail:
- Configure user impersonation for Hive and the MapR cluster.
-
Set hive.server2.enable.doAs to
false
inhive-site.xml
file.
See Hive User Impersonation for the steps to configure user impersonation for Hive and the MapR cluster.