Configuring Hive 2.3 and Tez 0.9

To configure Hive on Tez, repeat the following steps on each node where you want to configure Hive on Tez. Tez mode for MR jobs is not compatible with all MR jobs and so, do not set up the whole cluster to work on Tez.

On Ubuntu, while configuring the new version of Hive, you could have an issue caused by an incomplete removal of previously installed Hive packages. To avoid this issue, use the purge command for complete removal of all previously installed Hive packages.

  1. Install Tez 0.9 if it is already not installed.
    To install, run the following command:
    On CentOS / RedHat yum install mapr-tez
    On SUSE zypper install mapr-tez
    On Ubuntu apt-get install mapr-tez
    Note: Repeat this step on each node where you want Hive on Tez to be configured.
  2. Create the /apps/tez directory on MapR file system.
    To create, run the following commands:
    hadoop fs -mkdir /apps
    hadoop fs -mkdir /apps/tez
  3. Upload the Tez libraries to the tez directory on MapR file system.
    To upload, run the following commands:
    hadoop fs -put /opt/mapr/tez/tez-0.9 /apps/tez
    hadoop fs -chmod -R 755 /apps/tez
  4. Verify the upload.
    To verify, run the following command:
    hadoop fs -ls /apps/tez/tez-0.9
  5. Set the Tez environment variables. To set, open the /opt/mapr/hive/hive-2.3/conf/hive-env.sh file, add the following lines, and save the file:
    export TEZ_CONF_DIR=/opt/mapr/tez/tez-0.9/conf
    export TEZ_JARS=/opt/mapr/tez/tez-0.9/*:/opt/mapr/tez/tez-0.9/lib/*
    export HADOOP_CLASSPATH=$TEZ_CONF_DIR:$TEZ_JARS:$HADOOP_CLASSPATH
    Note: Repeat this step on each node where you want Hive on Tez to be configured.
  6. Configure Hive for Tez engine. To configure, open the /opt/mapr/hive/hive-2.3/conf/hive-site.xml file, add the following lines, and save the file.
    <property>
      <name>hive.execution.engine</name>
      <value>tez</value>
    </property>
    <property>
      <name>hive.exec.pre.hooks</name>
      <value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
    </property>
    Add the hive.exec.post.hooks property with value org.apache.hadoop.hive.ql.hooks.ATSHook to use the Hive queries page in the Tez UI.
    <property>
      <name>hive.exec.post.hooks</name>
      <value>org.apache.hadoop.hive.ql.hooks.ATSHook</value>
    </property>
    Note: Repeat this step on each node where you want Hive on Tez to be configured.
  7. Run configure.sh with the -R option.
    /opt/mapr/server/configure.sh -R
    Note: Starting in MEP 6.0.1 and above, Tez should be configured by running the $MAPR_HOME/server/configure.sh script with the -R option.