安装 Tez
系统环境
操作系统: CentOS 7 主机名: centos02 IP: 192.168.122.1 Java: 1.8 Hadoop: 2.8.5 Hive: 2.3.4
新建 Tez目录
[root@centos02 opt]# cd ./bigdata [root@centos02 bigdata]# mkdir -m 777 tez [root@centos02 bigdata]#
解压Tez到指定目录,并重命名目录名称
[root@centos02 opt]# tar -xvzf apache-tez-0.9.1-bin.tar.gz -C /opt/bigdata/tez [root@centos02 opt]# cd ./bigdata/tez [root@centos02 tez]# ll 总用量 4 drwxr-xr-x 5 501 games 4096 12月 13 2017 apache-tez-0.9.1-bin [root@centos02 tez]# [root@centos02 tez]# mv apache-tez-0.9.1-bin tez-0.9.1 [root@centos02 tez]# ll 总用量 4 drwxr-xr-x 5 501 games 4096 12月 13 2017 tez-0.9.1 [root@centos02 tez]#
添加环境变量
[root@centos02 tez]# vim /etc/profile
#Tez export TEZ_HOME=/opt/bigdata/tez/tez-0.9.1 export TEZ_CONF_DIR=$HADOOP_CONF_DIR export TEZ_JARS=$TEZ_HOME/*:$TEZ_HOME/lib/* export HADOOP_CLASSPATH=$TEZ_CONF_DIR:$TEZ_JARS:$HADOOP_CLASSPATH
[root@centos02 tez]# source /etc/profile
#Hadoop版本兼容问题
[root@centos02 tez]# cd $TEZ_HOME/lib [root@centos02 lib]# ll 总用量 10988 -rw-r--r-- 1 501 games 535731 2月 26 2016 async-http-client-1.8.16.jar -rw-r--r-- 1 501 games 41123 2月 26 2016 commons-cli-1.2.jar -rw-r--r-- 1 501 games 58160 2月 26 2016 commons-codec-1.4.jar -rw-r--r-- 1 501 games 588337 2月 26 2016 commons-collections-3.2.2.jar -rw-r--r-- 1 501 games 751238 2月 26 2016 commons-collections4-4.1.jar -rw-r--r-- 1 501 games 185140 2月 26 2016 commons-io-2.4.jar -rw-r--r-- 1 501 games 284220 2月 26 2016 commons-lang-2.6.jar -rw-r--r-- 1 501 games 1599627 2月 26 2016 commons-math3-3.1.1.jar -rw-r--r-- 1 501 games 1648200 2月 26 2016 guava-11.0.2.jar -rw-r--r-- 1 501 games 753214 4月 20 2017 hadoop-mapreduce-client-common-2.7.0.jar -rw-r--r-- 1 501 games 1528797 4月 20 2017 hadoop-mapreduce-client-core-2.7.0.jar -rw-r--r-- 1 501 games 130458 2月 26 2016 jersey-client-1.9.jar -rw-r--r-- 1 501 games 147952 2月 26 2016 jersey-json-1.9.jar -rw-r--r-- 1 501 games 81743 2月 26 2016 jettison-1.3.4.jar -rw-r--r-- 1 501 games 539912 2月 26 2016 jetty-6.1.26.jar -rw-r--r-- 1 501 games 177131 2月 26 2016 jetty-util-6.1.26.jar -rw-r--r-- 1 501 games 33031 2月 26 2016 jsr305-3.0.0.jar -rw-r--r-- 1 501 games 111908 2月 26 2016 metrics-core-3.1.0.jar -rw-r--r-- 1 501 games 1199572 2月 26 2016 netty-3.6.2.Final.jar -rw-r--r-- 1 501 games 533455 2月 26 2016 protobuf-java-2.5.0.jar -rw-r--r-- 1 501 games 124846 2月 26 2016 RoaringBitmap-0.4.9.jar -rw-r--r-- 1 501 games 105112 2月 26 2016 servlet-api-2.5.jar -rw-r--r-- 1 501 games 32119 2月 26 2016 slf4j-api-1.7.10.jar -rw-r--r-- 1 501 games 8866 2月 26 2016 slf4j-log4j12-1.7.10.jar [root@centos02 lib]#
替换两个JAR包 ( hadoop-mapreduce-client-common-2.7.0.jar、hadoop-mapreduce-client-core-2.7.0.jar )
[root@centos02 lib]# rm -rf $TEZ_HOME/lib/hadoop-mapreduce-client-common-2.7.0.jar [root@centos02 lib]# rm -rf $TEZ_HOME/lib/hadoop-mapreduce-client-core-2.7.0.jar [root@centos02 lib]# [root@centos02 lib]# cp $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-client-common-2.8.5.jar $TEZ_HOME/lib [root@centos02 lib]# cp $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-client-core-2.8.5.jar $TEZ_HOME/lib [root@centos02 lib]#
在Hadoop安装目录下的 etc/hadoop/etc/hadoop 下新建tez-site.xml
[root@centos02 lib]# cd $HADOOP_HOME/etc/hadoop [root@centos02 hadoop]# touch tez-site.xml [root@centos02 hadoop]# vim tez-site.xml [root@centos02 hadoop]#
<configuration> <property> <name>tez.lib.uris</name> <value>${fs.defaultFS}/user/tez/tez.tar.gz</value> </property> <property> <name>tez.container.max.java.heap.fraction</name> <value>0.2</value> </property> </configuration>
上传 tez.tar.gz 文件( 前提是已启动 Hadoop)
[root@centos02 hadoop]# cd $HADOOP_HOME/sbin [root@centos02 sbin]# start-all.sh This script is Deprecated. Instead use start-dfs.sh and start-yarn.sh SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/tez/tez-0.9.1/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/hive/hive-2.3.4/lib/log4j-slf4j-impl-2.6.2.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.slf4j.impl.Log4jLoggerFactory] Starting namenodes on [centos02] centos02: starting namenode, logging to /opt/bigdata/hadoop/hadoop-2.8.5/logs/hadoop-root-namenode-centos02.out localhost: starting datanode, logging to /opt/bigdata/hadoop/hadoop-2.8.5/logs/hadoop-root-datanode-centos02.out Starting secondary namenodes [0.0.0.0] 0.0.0.0: starting secondarynamenode, logging to /opt/bigdata/hadoop/hadoop-2.8.5/logs/hadoop-root-secondarynamenode-centos02.out SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/tez/tez-0.9.1/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/hive/hive-2.3.4/lib/log4j-slf4j-impl-2.6.2.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.slf4j.impl.Log4jLoggerFactory] starting yarn daemons starting resourcemanager, logging to /opt/bigdata/hadoop/hadoop-2.8.5/logs/yarn-root-resourcemanager-centos02.out SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/tez/tez-0.9.1/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/hive/hive-2.3.4/lib/log4j-slf4j-impl-2.6.2.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.slf4j.impl.Log4jLoggerFactory] localhost: starting nodemanager, logging to /opt/bigdata/hadoop/hadoop-2.8.5/logs/yarn-root-nodemanager-centos02.out [root@centos02 sbin]#
创建 HDFS目录,并上传 tez.tar.gz 文件
[root@centos02 bin]# hdfs dfs -mkdir /user/tez SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/tez/tez-0.9.1/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/hive/hive-2.3.4/lib/log4j-slf4j-impl-2.6.2.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.slf4j.impl.Log4jLoggerFactory] [root@centos02 bin]# [root@centos02 bin]# hdfs dfs -copyFromLocal /opt/bigdata/tez/tez-0.9.1/share/tez.tar.gz /user/tez/tez.tar.gz SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/bigdata/hadoop/hadoop-2.8.5/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/tez/tez-0.9.1/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/bigdata/hive/hive-2.3.4/lib/log4j-slf4j-impl-2.6.2.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.slf4j.impl.Log4jLoggerFactory] [root@centos02 bin]#
[root@centos02 bin]# hdfs dfs -ls /user/tez Found 1 items -rw-r--r-- 1 root supergroup 44854125 2019-09-23 17:06 /user/tez/tez.tar.gz [root@centos02 bin]#


浙公网安备 33010602011771号