1.上传tez.tar.gz至hdfs的/tez,随后在本地目录解压
2.在hive的conf目录下创建tez-site.xml
输入:
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>tez.lib.uris</name> <value>hdfs://ubuntu-00:9000/tez/apache-tez-0.9.1-bin.tar.gz</value> </property> <property> <name>tez.use.cluster.hadoop-libs</name> <value>true</value> </property> <property> <name>tez.history.logging.service.class</name> <value>org.apache.tez.dag.history.logging.impl.SimpleHistoryLoggingService</value> </property> </configuration>
3.vim hive-env.sh
#是你的 tez 的解压目录
export TEZ_HOME=/opt/module/tez-0.9.1
export TEZ_JARS=""
for jar in `ls $TEZ_HOME |grep jar`;
do
export TEZ_JARS=$TEZ_JARS:$TEZ_HOME/$jar
done
for jar in `ls $TEZ_HOME/lib`;
do
export TEZ_JARS=$TEZ_JARS:$TEZ_HOME/lib/$jar
done
export HIVE_AUX_JARS_PATH=/your/hadoop/share/hadoop/common/hadoop-lzo.jar$TEZ_JARS
4.vim hive-site.xml
修改引擎
<property> <name>hive.execution.engine</name> <value>tez</value> </property>
5. 测试
完美