一.搭建hadoop

第一步搭建好hadoop3.1版本,参考官方教程一步一步实现就好;

https://hadoop.apache.org/docs/r3.1.2/hadoop-project-dist/hadoop-common/SingleCluster.html

这里需要注意对应的hadoop版本,每个版本可能会有一些差别

二.tez安装

1.编译tez

http://tez.apache.org/install.html

在官方的tez安装过程中踩了坑,打包的过程如果直接使用

mvn clean package -DskipTests=true -Dmaven.javadoc.skip=true

编译出来的tez对应的jar包会出现版本不匹配的问题

下载0.9.2版本的源码http://www.apache.org/dyn/closer.lua/tez/0.9.2/

此处需要参考源码中的BUILDING.txt

另外因为部署的tez-ui会和hadoop交互,但是tez-0.9.2使用的是jersey 1.9版本,hadoop-3.1.2使用的是1.19版本,编译前需要将pom.xml中的版本修改为1.19版本;

需要有maven,在项目的根目录下执行

mvn clean package -DskipTests=true -Dhadoop.version=3.1.2 -Phadoop28 -P\!hadoop27 -Dmaven.javadoc.skip=true

环境依赖

编译之前需要安装proto 2.5,另外tez-ui模块打包的过程涉及到部分前端组件的安装,参考网上的例子也都能解决;

第一次编译的时间可能会比较长,需要下载的依赖包比较多

2.部署tez

将tez-dist目录下的tez-0.9.2.tar.gz放到hdfs /apps/tez-0.9.2目录下(这里官网提供了两种方法,可以直接使用mini包,并在tez-site.xml中Set tez.use.cluster.hadoop-libs to true),将minimal解压到本地目录

创建hdfs目录

hadoop fs -mkdir  /apps
    hadoop fs -mkdir  /apps/tez-0.9.2

将tez压缩包放在hdfs建好的目录下

hadoop fs -put /path/tez-dist/target/tez-0.9.2.tar.gz /apps/tez-0.9.2/

将tez压缩包解压到部署主机的安装目录下

tar -xvf /path/tez-dist/target/tez-0.9.2-minimal.tar.gz -C /opt/tez-0.9.2

需要添加HADOOP_CLASSPATH变量,添加的作用是在hive启动的时候能够找到这些配置及jar包并加载初始化

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

在hadoop配置目录下,配置tez-site.xml如下所示:

[root@wentjiang103 tez-0.9.2]# cat /opt/hadoop-3.1.2/etc/hadoop/tez-site.xml
<configuration>
    <property>
        <name>tez.lib.uris</name>
        <value>${fs.defaultFS}/apps/tez-0.9.2/tez-0.9.2.tar.gz</value>
    </property>
<property>
</configuration>

修改mapred-site.xml配置文件

Modify mapred-site.xml to change “mapreduce.framework.name” property from its default value of “yarn” to “yarn-tez”

<configuration>
 <property>
    <name>mapreduce.framework.name</name>
    <value>yarn-tez</value>
  </property>
<property>
</configuration>

创建一个文件test.txt,随便写入内容,放到hdfs中

hadoop fs -put  ./test.txt /input

由于在虚拟机中运行,资源比较小,需要将mapred-site.xml添加,否则会资源太少无法执行,

<property>
  <name>mapreduce.map.memory.mb</name>
  <value>512</value>
  <description>The amount of memory to request from the scheduler for each
    map task. If this is not specified or is non-positive, it is inferred from
    mapreduce.map.java.opts and mapreduce.job.heap.memory-mb.ratio.
    If java-opts are also not specified, we set it to 1024.
  </description>
</property>

<property>
  <name>mapreduce.reduce.memory.mb</name>
  <value>512</value>
  <description>The amount of memory to request from the scheduler for each
    reduce task. If this is not specified or is non-positive, it is inferred
    from mapreduce.reduce.java.opts and mapreduce.job.heap.memory-mb.ratio.
    If java-opts are also not specified, we set it to 1024.
  </description>
</property>

tez安装目录执行

hadoop jar tez-examples-0.9.2.jar orderedwordcount /input /output

虚拟机内存设置4G还是会报虚拟内存不足,把虚拟机内存修改为8G,可以正常运行

查看输出结果

至此,官方示例已经全部跑通

三.集成tez-ui

tez-ui的官网介绍

http://tez.apache.org/tez-ui.html

tez-ui的数据源介绍

http://tez.apache.org/tez_ui_user_data.html

tez-ui需要结合yarn的timeline使用,timeline提供了tez-ui的数据源

修改tez配置,tez-site.xml添加

<property><description>Enable Tez to use the Timeline Server for History Logging</description><name>tez.history.logging.service.class</name><value>org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService</value>
</property><property><description>URL for where the Tez UI is hosted</description><name>tez.tez-ui.history-url.base</name><value>http://<webserver-host:9999/tez-ui/</value>
</property>

注意tez.tez-ui.history-url.base需要填写tomcat部署的地址我本地的为http://wentjiang101:8080/tez-ui-0.9.2/,需要修改成你的配置;

将源码目录下打包的war包apache-tez-0.9.2-src/tez-ui/target/tez-ui-0.9.2.war放在tomcat /opt/apache-tomcat-8.5.47/webapps目录下,启动

timeline除了tez-ui网站上的配置之外还需要添加,下边的配置,才能保存历史日志,否则timeline默认不持久化日志

<property><name>yarn.log-aggregation-enable</name><value>true</value>
</property>

前端配置修改

前端打包的时候需要修改Timeline Server URL和Resource Manager UI URL

在scripts/configs.env 中修改这两个配置为部署的timeline地址和RM地址,

    // timelineBaseUrl: 'http://localhost:8188',// RMWebUrl: 'http://localhost:8088',

这里需要注意,前端的//不生效,所以需要将//里的内容直接修改为你的地址;

不是好timeline和tez-ui之后,我们尝试执行hive on tez命令,发现出现了NoSuchMethodError错误

org.apache.hadoop.service.ServiceStateException: java.lang.NoSuchMethodError: com.sun.jersey.api.client.ClientResponse.getStatusInfo()Ljavax/ws/rs/core/Response$StatusType;

查看引用包发现,hadoop引用的jersey是1.19版本,tez引用的是1.9版本,这里需要将tez引用的1.9替换为1.19版本,重新打包部署即可

这样就能愉快的使用tez-ui了

三表join做查询

select * from student join bag join grade where student.id = bag.studentId and student.id = grade.studentId

另外tez-ui是有两个tab页面,第二个tab页面hive query需要在hive-site.xml中添加一些配置,参考ATSHook的描述即可

四.更详尽的内容

参考我的另一篇博客:https://blog.csdn.net/lo085213/article/details/104753170

hadoop3.1集成tez和tez-ui相关推荐

  1. Tez的web UI简单体验

    Tez的web UI简单体验 前言 由于CDP7默认是Hive On Tez,不再有Map Reduce和Spark什么事,查看监控.分析数据倾斜等原因导致的HQL任务跑不快的问题没有使用Spark那 ...

  2. Invalid configuration of tez jars, tez.lib.uris is not defined in the configuration

    HDP3使用apache版Spark2.4查询hive时报错: Caused by: java.lang.RuntimeException: org.apache.tez.dag.api.TezUnc ...

  3. Hive On Tez,Tez 和 MapReduce engine 性能对比

    2019独角兽企业重金招聘Python工程师标准>>> 接上一篇文章: https://my.oschina.net/zhzhenqin/blog/781670 Tez On Yar ...

  4. Hive On Tez,Tez 和 MapReduce engine 参数优化

    Hive On Tez Hive 默认支持 MapReduce,Tez,Spark(在 SparkSQL 中支持) 等执行引擎.因此给 Hive 换上 Tez 非常简单,只需给 hive-site.x ...

  5. 【Knox】CDP集群Knox服务集成LDAP,WEB UI登录正常,使用RestAPI无法正常访问401 Authentication failed 解决方式

    问题经过 最近在使用Knox 服务集成 LDAP 后,在 Knox Web UI 界面中,使用Ldap 用户名.密码能够成功登录,但是在使用REST API 请求服务数据时,就会报401 Authen ...

  6. 集成融云直播UI的时候提示_matroska_decode_buffer in KSYMediaPlayer(matroskadec.o)

    1.提示 Showing Recent Messages "std::_List_node_base::unhook()", referenced from: 错误的时候,需要导入 ...

  7. 启用Kerberos后,如何使用Tez UI

    Ambari自从2.7版本以后不再提供TezUI Views,如果集群启用Kerberos,对于如何使用Tez UI呢?我们也搜索了好久资料,一直没有太好的解决方案,经过最近的一些努力,我们现在可以提 ...

  8. hive on tez集成完整采坑指南(含tez-ui及安全环境)

    hive on tez 介绍 tez是hive官方推荐的一个有向无环图的执行引擎,从测试结果来看,相对于mr是数量级上的提升 使用版本 hadoop 3.1.1 hive 3.1.0 tez 0.9. ...

  9. Hive集成Tez让大象飞起来

    [img]http://dl2.iteye.com/upload/attachment/0114/5700/de4b9062-7d61-3ea5-995d-5ae35deb61c0.jpg[/img] ...

最新文章

  1. centos oracle 服务自动启动,CentOS下配置Oracle 11gR2为系统服务自动启动
  2. ping: sendto: Network is unreachable
  3. Linux服务器下安装配置Nginx的教程
  4. 分區策略與數據傾斜處理策略的區別
  5. 我的docker随笔8:docker容器相互访问
  6. SAP License:电子行业ERP实施
  7. Eclipse 有望超越 Visual Studio!
  8. Cognos8.3解决方案
  9. 爬虫_抓取51job招聘数据
  10. 游戏开发之C++Vector动态数组及其迭代器的实现--简单版(C++基础)
  11. 快速得到容器ID和veth bridge interface的关系
  12. 网站颜色搭配[收藏]
  13. 阿里代码规范检测工具-eclipse
  14. centos7 安装sogou输入法
  15. 电梯服务器系统,OTS电梯服务器TT使用说明.pdf
  16. Unity功能记录(七)------ UGUI获取UI在Canvas下的坐标/根据UI位置获取屏幕图片/二维码识别
  17. warnings模块
  18. 基于脱敏数据,使用huggingface的Transformers预训练模型
  19. 河北工业大学数据挖掘实验四 贝叶斯决策分类算法
  20. 谷歌浏览器开通flash的访问权限的方式

热门文章

  1. 【Oracle】创建概要文件
  2. angularjs路由监听,uirouter感知路由变化,解决uirouter路由监听不生效的问题
  3. Google 已将“xxxx”标记为恶意扩展程序并阻止安装,解决方案
  4. Ubuntu 16.04 安装 CUDA10.1 (解决循环登陆的问题)
  5. JavaScript截断/切片/修剪掉字符串中的最后一个字符
  6. 数据库连接池配置和优化
  7. git/SmartGit切换用户
  8. Spring集合类型属性注入
  9. 问答 | 为什么两轮差速机器人转向运动是圆周运动
  10. 项目使用线程池_并发编程系列1:线程池的架构实现、大小配置、及四种线程池使用...