微信搜索lxw1234bigdata | 邀请体验:数阅–数据管理、OLAP分析与可视化平台 | 赞助作者:赞助作者

轻松配置Hive On Tez

Hive lxw1234@qq.com 28023℃ 5评论

关于Apche Tez,请自行搜索,较MR,它能提升分布式作业的性能。本文介绍的是Hive使用Tez作为执行引擎。

我的环境:

hadoop-2.6.0-cdh5.8.3

apache-hive-2.1.1-bin

下载Apache Tez

wget http://www-us.apache.org/dist/tez/0.8.5/apache-tez-0.8.5-bin.tar.gz

在本机建立tez安装目录 /data/bigdata/tez/current , 并解压apache-tez-0.8.5-bin.tar.gz

配置Tez

将$TEZ_HOME/share/tez.tar.gz 上传至HDFS目录:hdfs://cdh5/apps/tez/

在$TEZ_HOME/conf下新建tez-site.xml

<configuration>

<property>
<name>tez.lib.uris</name>
<value>hdfs://cdh5/apps/tez/tez.tar.gz</value>
</property>

<property>
<name>tez.use.cluster.hadoop-libs</name>
<value>true</value>
</property>

<property>
<name>tez.runtime.compress</name>
<value>true</value>
</property>

<property>
<name>tez.runtime.compress.codec</name>
<value>org.apache.hadoop.io.compress.SnappyCodec</value>
</property>

</configuration>

配置Hive

编辑$HIVE_HOME/conf/hive-env.sh,增加下面配置:

## for tez

export TEZ_HOME=/data/bigdata/tez/current

export TEZ_CONF_DIR=/etc/hadoop/conf

export HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${TEZ_CONF_DIR}:${TEZ_HOME}/*:${TEZ_HOME}/lib/*

测试Hive On Tez

使用命令

$HIVE_HOME/bin/hive –hiveconf hive.execution.engine=tez 进入hive-cli:

执行一个查询SQL:

tez

初步测试,Hive On Tez 比 Hive On MR 执行性能提升2~3倍以上。

另外,如果你使用的是社区版的Hadoop、或者HDP版本的Hadoop,可以尝试一下Hive+Tez+LLAP,据说性能提升25倍以上,和Impala、Presto不相上下,

但CDH版本的Hadoop目前不支持LLAP。

 

 

 

 

如果觉得本博客对您有帮助,请 赞助作者

转载请注明:lxw的大数据田地 » 轻松配置Hive On Tez

喜欢 (10)
分享 (0)
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(5)个小伙伴在吐槽
  1. 为什么我切换engine为tez之后,显示还是mr,执行的任务在Yarn UI上看到的也是MR类型。我用的是hadoop原生的2.7.3,tez是0.8.5, hive是2.1.1 hive> set hive.execution.engine=tez; hive> show conf 'hive.execution.engine'; OK mr STRING Expects one of [mr, tez, spark]. Chooses execution engine. Options are: mr (Map reduce, default), tez, spark. While MR remains the default engine for historical reasons, it is itself a historical engine and is deprecated in Hive 2 line. It may be removed without further warning. Time taken: 0.006 seconds, Fetched: 1 row(s)
    阿磊2017-06-13 14:48 回复
    • 请问已经找到了解决方案吗?我也遇到了这样的情况
      浮云2019-02-15 19:49 回复
  2. lz,什么时候能写一篇llap的踩坑教程?通过slider部署llap,发现llapdaemon进行死活起不来
    txhsj2017-06-29 09:01 回复
  3. 您好,请问一下, hive on tez 基于CDH集群部署,在hive中用tez引擎可以查询数据,但是 tez-ui访问不了, 日志报错: 2018-01-30 11:29:06,039 [ERROR] [HistoryEventHandlingThread] |impl.TimelineClientImpl|: Failed to get the response from the timeline server. 2018-01-30 11:29:06,039 [WARN] [HistoryEventHandlingThread] |ats.ATSHistoryLoggingService|: Could not handle history events org.apache.hadoop.yarn.exceptions.YarnException: Failed to get the response from the timeline server. at org.apache.hadoop.yarn.client.api.impl.TimelineClientImpl.doPosting(TimelineClientImpl.java:339) at org.apache.hadoop.yarn.client.api.impl.TimelineClientImpl.putEntities(TimelineClientImpl.java:301) at org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService.handleEvents(ATSHistoryLoggingService.java:358) at org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService.access$700(ATSHistoryLoggingService.java:53) at org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService$1.run(ATSHistoryLoggingService.java:190) at java.lang.Thread.run(Thread.java:748) 我已经通过 yarn timelineserver 启动了 timelineserver 服务。 大神您那边tez-tui是否正常显示呢, hadoop 版本 2.6.0-cdh5.11.0 感谢!已经折腾好几天了,ui就是显示不出来。
    小黑车2018-01-30 11:53 回复
    • 这个问题解决了么,现在,请问。
      呵呵哈2019-05-16 11:23 回复