环境:
CentOS 7.4
hadoop-2.7.4
下载:
wget http://mirror.ox.ac.uk/sites/rsync.apache.org/tez/0.9.0/apache-tez-0.9.0-bin.tar.gz
tar xvf apache-tez-0.9.0-bin.tar.gz
将 Tez 包上传到 HDFS:
hdfs dfs -mkdir /tez # 自定义目录
hdfs dfs -put share/tez.tar.gz /tez
hdfs dfs -ls /tez
新建 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>${fs.defaultFS}/tez/tez.tar.gz</value>
</property>
</configuration>
修改 Hadoop 配置文件 etc/hadoop/hadoop-env.sh
export TEZ_HOME=/home/vagrant/apps/apache-tez-0.9.0-bin
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$TEZ_HOME/*:$TEZ_HOME/lib/*:$TEZ_HOME/conf/
修改 Hadoop 配置文件 mapred-site.xml
:
<property>
<name>mapreduce.framework.name</name>
<value>yarn-tez</value>
</property>
如果 Hadoop 是分布式部署,则所有节点都要修改。然后重启 Hadoop 集群。
提交一个任务:
cd apache-tez-0.9.0-bin
hdfs dfs -put conf/*.xml input
hadoop jar tez-examples-0.9.0.jar orderedwordcount input output
hdfs dfs -cat output/*
查看网页 http://localhost:8088,可以看到 Application Type 是 TEZ。
HI!
Have you solved this issue? How
Thanks in advance!