Steps to Install Hive Using Manual Steps

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.

Note: The MapR cluster must be up and running before installing Hive.
The following procedure uses the operating system package managers to download and install Hive from the MapR Repository.
Note: Make sure to install the same version for all Hive packages.
Execute the following commands as root or using sudo.
  1. Update the repository cache on all nodes:
    On RedHat/CentOS
    # yum clean all
    On SUSE
    # zypper refresh
    On Ubuntu
    # apt-get update
  2. 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 install mapr-hiveserver2 and mapr-hivemetastore on the same node as mapr-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 install mapr-hiveserver2 and mapr-hivemetastore on the same node as mapr-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:
      yum list --showduplicates mapr-hive
      Then, you can run the following command to install a specific package:
      yum install mapr-hive-<version>
      On Ubuntu Determine the available versions with the following command:
      apt-cache madison mapr-hive
      Then, you can run the following command to install a specific package:
      apt-get install mapr-hive=<version>
  3. Run configure.sh:
    /opt/mapr/server/configure.sh -R
  4. 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.

After Hive is installed, the executable is located at: /opt/mapr/hive/hive-<version>/bin/hive

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 in hive-site.xml file.

See Hive User Impersonation for the steps to configure user impersonation for Hive and the MapR cluster.