当前位置:网站首页>在Oozie中配置 map-reduce workflow
在Oozie中配置 map-reduce workflow
2022-07-17 00:12:00 【sun_xo】
## prepare wordcount case
$ cd ~/work/oozie-5.2.1
$ tree oozie
oozie
├── apps
│ └── wordcount
│ ├── job.properties
│ ├── job.properties.orig
│ ├── lib
│ │ └── wordcount.jar
│ ├── workflow.xml
│ └── workflow.xml.orig
└── data
└── wordcount
└── input
└── in.txt
$ cat oozie/apps/wordcount/job.properties
nameNode=hdfs://localhost:9000
resourceManager=localhost:8032
queueName=default
oozieRoot=user/${user.name}/oozie
oozie.wf.application.path=${nameNode}/${oozieRoot}/apps/wordcount/workflow.xml
inputDir=data/wordcount/input
outputDir=data/wordcount/output$ cat oozie/apps/wordcount/workflow.xml
<workflow-app xmlns="uri:oozie:workflow:1.0" name="wordcount-wf">
<start to="wordcount-node"/>
<action name="wordcount-node">
<map-reduce>
<resource-manager>${resourceManager}</resource-manager>
<name-node>${nameNode}</name-node>
<prepare>
<delete path="${nameNode}/${oozieRoot}/${outputDir}"/>
</prepare>
<configuration>
<property>
<name>mapred.mapper.new-api</name>
<value>true</value>
</property>
<property>
<name>mapred.reducer.new-api</name>
<value>true</value>
</property>
<property>
<name>mapreduce.job.queuename</name>
<value>${queueName}</value>
</property>
<property>
<name>mapreduce.job.map.class</name>
<value>WordCount$TokenizerMapper</value>
</property>
<property>
<name>mapreduce.job.reduce.class</name>
<value>WordCount$IntSumReducer</value>
</property>
<property>
<name>mapreduce.job.output.key.class</name>
<value>org.apache.hadoop.io.Text</value>
</property>
<property>
<name>mapreduce.job.output.value.class</name>
<value>org.apache.hadoop.io.IntWritable</value>
</property>
<property>
<name>mapreduce.input.fileinputformat.inputdir</name>
<value>${nameNode}/${oozieRoot}/${inputDir}</value>
</property>
<property>
<name>mapreduce.output.fileoutputformat.outputdir</name>
<value>${nameNode}/${oozieRoot}/${outputDir}</value>
</property>
</configuration>
</map-reduce>
<ok to="end"/>
<error to="fail"/>
</action>
<kill name="fail">
<message>Map/Reduce failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>
Note: all key / value pairs in workflow.xml can be searched from
http://localhost:8088/cluster -> Application's History -> Job / Configuration
$ cat oozie/data/wordcount/input/in.txt
hadoop
mapreduce
hdfs
hbase
hdfs
spark
hive
hcatalog
sqoop
flume
kafka
oozie
hue## upload case
$ hdfs dfs -put oozie /user/sun_xo/oozie
$ hdfs dfs -rm -f -r /user/sun_xo/oozie/data/wordcount/output
## start oozie
$ cd ~/work/oozie-5.2.1
$ bin/oozied.sh start
$ export OOZIE_URL=http://localhost:11000/oozie
$ bin/oozie job -config oozie/apps/wordcount/job.properties -run
job: 0000000-220523112321053-oozie-sun_-W
$ bin/oozie job -info 0000000-220523112321053-oozie-sun_-W
ob ID : 0000000-220602202911687-oozie-sun_-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : wordcount-wf
App Path : hdfs://localhost:9000/user/sun_xo/oozie/apps/wordcount/workflow.xml
Status : SUCCEEDED
Run : 0
User : sun_xo
Group : -
Created : 2022-06-02 12:30 GMT
Started : 2022-06-02 12:30 GMT
Last Modified : 2022-06-02 12:30 GMT
Ended : 2022-06-02 12:30 GMT
CoordAction ID: -
Actions
------------------------------------------------------------------------------------------------------------------------------------
ID Status Ext ID Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
[email protected]:start: OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK application_1653709899071_0004SUCCEEDED -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK - OK -
------------------------------------------------------------------------------------------------------------------------------------$ hdfs dfs -cat "/user/sun_xo/oozie/data/wordcount/output/*"
flume 1
hadoop 1
hbase 1
hcatalog 1
hdfs 2
hive 1
hue 1
kafka 1
mapreduce 1
oozie 1
spark 1
sqoop 1reference: 搭建Ozzie环境
reference: 搭建map-reduce开发环境
边栏推荐
- Switch details
- Factory method mode notes
- Can protocol communication
- FS32K148调试之WDOG与电源模式
- A causal linear model to quantify edge unfairness for unfair edge prioritization
- ViLT Vision-and-Language Transformer Without Convolution or Region Supervision
- C语言程序之编译,链接
- 【萌新解题】三数之和
- [literature reading] vaqf: full automatic software hardware co design framework for low bit vision transformer
- 性能强悍的图表组件库 ScottPlot
猜你喜欢
![[literature reading] counting integer points in parametric polymers using barvinok's rational functions](/img/a2/3e1b248c7cd853ffea7a835111db65.png)
[literature reading] counting integer points in parametric polymers using barvinok's rational functions

静态库与动态库

Owl Eyes: Spotting UI Display Issues via Visual Understanding

动手学深度学习---深度学习计算篇

Frustratingly Simple Few-Shot Object Detection

Can protocol communication

Handling conditional discrimination

CAN协议通信
![[vernacular analog 1] PN junction and diode](/img/a8/26d3dc49eb74b7c8c5970ddbd31b65.png)
[vernacular analog 1] PN junction and diode

ROC 曲线讲解 (Receiver Operarating Curve)
随机推荐
Characteristics and application points of electrolytic capacitor
Allegro Design Entry CIS 和 Orcad Capture CIS 关系
[literature reading] multi state MRAM cells for hardware neural computing
二阶边缘检测 - Laplacian of Guassian 高斯拉普拉斯算子
VIM profile
[literature reading] vaqf: full automatic software hardware co design framework for low bit vision transformer
[vernacular analog 1] PN junction and diode
Can protocol communication
动手学深度学习---从全连接层到卷积层篇
[translation] transformers in computer vision
02基于ZigBee的智能家居系统设计
二階邊緣檢測 - Laplacian of Guassian 高斯拉普拉斯算子
[literature reading] mcunet: tiny deep learning on IOT devices
Learning Transferable Visual Models From Natural Language Supervision
DGC最佳实践:机密数据入湖,如何保证数据不被泄露?
SAE J1708/J1587 协议详解
Boost线程池
iFair: Learning Individually Fair Data Representations for Algorithmic Decision Making
Valgrind详细教程(1) Memcheck
Oozie 集成 Sqoop