Configuring Hive 2.1 and Tez 0.8
About this task
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.
Procedure
-
Install Tez 0.8 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. -
Create the
/apps/tez
directory on MapR file system.To create, run the following commands:hadoop fs -mkdir /apps hadoop fs -mkdir /apps/tez
-
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.8 /apps/tez hadoop fs -chmod -R 755 /apps/tez
-
Verify the upload.
To verify, run the following command:
hadoop fs -ls /apps/tez/tez-0.8
-
Set the Tez environment variables. To set, open the
/opt/mapr/hive/hive-2.1/conf/hive-env.sh
file, add the following lines, and save the file:export TEZ_CONF_DIR=/opt/mapr/tez/tez-0.8/conf export TEZ_JARS=/opt/mapr/tez/tez-0.8/*:/opt/mapr/tez/tez-0.8/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. -
Configure Hive for Tez engine. To configure, open the
/opt/mapr/hive/hive-2.1/conf/hive-site.xml
file, add the following lines, and save the file.<property> <name>hive.execution.engine</name> <value>tez</value> </property>
NOTE: Repeat this step on each node where you want Hive on Tez to be configured.