当前位置:网站首页>Oozie 集成 Shell
Oozie 集成 Shell
2022-07-17 00:12:00 【sun_xo】
1) prepare shell case
$ cd ~/work/oozie-5.2.1
$ tree oozie/apps/shell
oozie/apps/shell
├── hello.sh
├── job.properties
└── workflow.xml$ cat oozie/apps/shell/hello.sh
#!/bin/sh
echo "my_output=Hello Oozie"$ cat oozie/apps/shell/job.properties
nameNode=hdfs://localhost:9000
resourceManager=localhost:8032
queueName=default
oozieRoot=user/${user.name}/oozie
oozie.wf.application.path=${nameNode}/${oozieRoot}/apps/shell
EXEC=hello.sh$ cat oozie/apps/shell/workflow.xml
<workflow-app xmlns="uri:oozie:workflow:1.0" name="shell-wf">
<start to="shell-node"/>
<action name="shell-node">
<shell xmlns="uri:oozie:shell-action:1.0">
<resource-manager>${resourceManager}</resource-manager>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<exec>${EXEC}</exec>
<file>${nameNode}/${oozieRoot}/apps/shell/${EXEC}#${EXEC}</file>
<capture-output/>
</shell>
<ok to="check-output"/>
<error to="fail"/>
</action>
<decision name="check-output">
<switch>
<case to="end">
${wf:actionData('shell-node')['my_output'] eq 'Hello Oozie'}
</case>
<default to="fail-output"/>
</switch>
</decision>
<kill name="fail">
<message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<kill name="fail-output">
<message>Incorrect output, expected [Hello Oozie] but was [${wf:actionData('shell-node')['my_output']}]</message>
</kill>
<end name="end"/>
</workflow-app>2) upload to hdfs
$ hdfs dfs -put oozie/apps/shell oozie/apps/
3) run and check
$ bin/oozie job -config oozie/apps/shell/job.properties -run
job: 0000004-220629164930563-oozie-sun_-W
$ bin/oozie job -info 0000004-220629164930563-oozie-sun_-W
Job ID : 0000004-220629164930563-oozie-sun_-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : shell-wf
App Path : hdfs://localhost:9000/user/sun_xo/oozie/apps/shell
Status : SUCCEEDED
Run : 0
User : sun_xo
Group : -
Created : 2022-06-29 09:22 GMT
Started : 2022-06-29 09:22 GMT
Last Modified : 2022-06-29 09:22 GMT
Ended : 2022-06-29 09:22 GMT
CoordAction ID: -
Actions
------------------------------------------------------------------------------------------------------------------------------------
ID Status Ext ID Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
[email protected]:start: OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK application_1656492227290_0007SUCCEEDED -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK - end -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
Note:
Shell action’s stdout and stderr output are redirected to the Oozie Launcher map-reduce job task STDOUT that runs the shell command
The output can be found under hdfs://localhost:9000/tmp/sun_xo/logs/application_1656492227290_0007/
application_1656492227290_0007 is ext_id of shell-node
边栏推荐
- The differences and usage of cookies, localstorage and sessionstorage
- 01 design of intelligent warehouse management system based on RFID
- SAE J1708/J1587 协议详解
- Can protocol communication
- L1,L2范数
- 指針常量與常量指針愛恨情仇
- VIM 配置文件
- 性能强悍的图表组件库 ScottPlot
- Frustratingly Simple Few-Shot Object Detection
- ROC 曲线讲解 (Receiver Operarating Curve)
猜你喜欢

Handling Conditional Discrimination(可解释歧视和确切的歧视)

【文献阅读】Small-Footprint Keyword Spotting with Multi-Scale Temporal Convolution

bais mintigation post-processing for individual and group fairness

【文献阅读】TENET: A Framework for Modeling Tensor Dataflow Based on Relation-centric Notation

On the properties and methods of list < t >

Fisher线性判别分析Fisher Linear Distrimination
![[literature reading] tenet: a framework for modeling tensor dataflow based on relational centric notation](/img/2a/786d78cee28382a593cd664695e3b9.png)
[literature reading] tenet: a framework for modeling tensor dataflow based on relational centric notation

openGauss Developer Day 2022|东方通诚邀您莅临“东方通生态工具分论坛”
![[translation] transformers in computer vision](/img/94/a6b8fdddca0e3042e1da7f945aeebe.png)
[translation] transformers in computer vision

06基于STM32的智能电子药盒设计
随机推荐
Owl Eyes: Spotting UI Display Issues via Visual Understanding
CAN协议通信
[literature reading] mcunet: tiny deep learning on IOT devices
Allegro Design Entry CIS 和 Orcad Capture CIS 关系
Apt get update error: hash checksum does not match
动手学深度学习---深度学习计算篇
Neutralizing Self-Selection Bias in Sampling for Sortition
【文献阅读】Multi-state MRAM cells for hardware neuromorphic computing
【文献阅读】TENET: A Framework for Modeling Tensor Dataflow Based on Relation-centric Notation
Monitor browser return operation - prohibit returning to the previous page
Rivaliser pour la guerre clé des utilisateurs de stock, aider les entreprises à construire un système d'étiquetage parfait 丨 01 examen en direct
Fairness in Deep Learning: A Computational Perspective
Valgrind detailed tutorial (1) MemCheck
PCA主成分分析(降维)过程推导
14:07:08 ckati failed with: signal: killed
如何理解Volatile以及如何使用它
Factory method mode notes
Frustratingly Simple Few-Shot Object Detection
[literature reading] tenet: a framework for modeling tensor dataflow based on relational centric notation
数组定义格式