Hive2安装Tez计算引擎

Hive2安装Tez计算引擎,第1张

Hive2安装Tez计算引擎 一、Tez介绍

ApacheTEZ®项目旨在构建一个应用程序框架,该框架允许使用复杂的有向无环图来处理数据。 它当前构建在Apache Hadoop YARN之上。 Tez的2个主要设计主题是: 通过以下方式增强最终用户的能力: 富有表现力的数据流定义API 灵活的输入-处理器-输出运行时模型 不可知数据类型 简化部署 执行性能 与Map Reduce相比性能提升 最佳资源管理 在运行时计划重新配置 动态物理数据流决策

通过允许诸如Apache Hive和Apache Pig之类的项目运行复杂的DAG任务,Tez可以用于处理数据,该数据以前需要执行多个MR作业,而现在在单个Tez作业中,如下所示。

二、安装指南

 1)下载 tez 的依赖包:Apache Tez – Welcome to Apache TEZ® 或从国内镜像源下载 Index of apache-local/tez/0.9.2 https://mirrors.huaweicloud.com/apache/tez/0.9.2/

2)拷贝 apache-tez-0.9.2-bin.tar.gz 到 houda 的/software 目录

  1. 解压安装包到opt下

[root@houda share]# tar -zxvf /software/apache-tez-0.9.2-bin.tar.gz -C /opt/
  1. 修改文件名字

[root@houda share]# mv /opt/apache-tez-0.9.2-bin /opt/tez

5)将 tez.tar.gz 上传到 HDFS 的/tez 目录下

[root@houda opt]# cd /opt/tez/share/
[root@houda opt]# hadoop fs -mkdir /tez
[root@houda share]# hadoop fs -put ./tez.tar.gz /tez
  1. 避免与hadoop、hive日志jar包冲突,删除tez的log4j包

[root@houda share]# rm -rf /opt/tez/lib/slf4j-log4j12-1.7.10.jar

7)在hadoop创建tez-site.xml文件

[root@houda share]# vim /opt/hadoop-2.7.6/etc/hadoop/tez-site.xml



tez.lib.uris
hdfs://houda:9000/tez/tez.tar.gz


tez.use.cluster.hadoop-libs
true


  Enable Tez to use the Timeline Server for History Logging
  tez.history.logging.service.class
  org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService

  1. 编辑hadoop-env.sh脚本,在脚本最后,增加配置

[root@hd01 share]# vim /opt/hadoop-2.7.6/etc/hadoop/hadoop-env.sh
export TEZ_CONF_DIR=/opt/hadoop-2.7.6/etc/hadoop
export TEZ_JARS=/opt/tez/
export HADOOP_CLASSPATH=${HADOOP_CLASSPATH}:${TEZ_CONF_DIR}:${TEZ_JARS}/*:${TEZ_JARS}/lib/*
  1. 在yarn-site.xml中设置nodemanager的资源配置

[root@houda share]# vim /opt/hadoop-2.7.6/etc/hadoop/yarn-site.xml
 

    yarn.nodemanager.resource.memory-mb
    22528
    每个节点可用内存,单位MB

    yarn.scheduler.minimum-allocation-mb
    1500
    单个任务可申请最少内存,默认1024MB

    yarn.scheduler.maximum-allocation-mb
    16384
    单个任务可申请最大内存,默认8192MB
  1. 在hive-site.xml中设置tez计算引擎

[root@hd01 share]# vim /opt/hive-2.3.3/conf/hive-site.xml

hive.execution.engine
tez
  1. 重启hadoop服务测试

[root@houda share]# stop-all.sh && start-all.sh
[root@houda share]# hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/hadoop-2.7.6/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Logging initialized using configuration in file:/opt/hive/conf/hive-log4j2.properties Async: true
hive (default)> select count(*) from default.emp;
Query ID = root_20201025200104_58fc10de-25ac-4acc-8d11-24fe0b0c7f0c
Total jobs = 1
Launching Job 1 out of 1
Status: Running (Executing on YARN cluster with App id application_1603626670053_0003)
----------------------------------------------------------------------------------------------
        VERTICES      MODE        STATUS  TOTAL  COMPLETED  RUNNING  PENDING  FAILED  KILLED
----------------------------------------------------------------------------------------------
Map 1 .......... container     SUCCEEDED      1          1        0        0       0       0
Reducer 2 ...... container     SUCCEEDED      1          1        0        0       0       0
----------------------------------------------------------------------------------------------
VERTICES: 02/02  [==========================>>] 100%  ELAPSED TIME: 3.63 s
----------------------------------------------------------------------------------------------
OK
_c0
14
Time taken: 6.419 seconds, Fetched: 1 row(s)
  1. 运算成功,说明修改成功。

 

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5636115.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-16
下一篇2022-12-16

发表评论

登录后才能评论

评论列表(0条)

    保存