当前位置:网站首页>Oozie integrated sh
Oozie integrated sh
2022-07-19 02:05:00 【sun_ xo】
1) prepare ssh case
$ cd ~/work/oozie-5.2.1
$ tree oozie/apps/ssh
├── job.properties
├── mushishi.sh
└── workflow.xml$ cat oozie/apps/ssh/mushishi.sh
#!/bin/sh
rm /tmp/mushishi_*.txt
echo "$1 $JAVA_HOME" > /tmp/mushishi_$$.txt
# env >> /tmp/mushishi_$$.txt
echo "Mushishi=$1"$ cat oozie/apps/ssh/job.properties
nameNode=hdfs://localhost:9000
resourceManager=localhost:8032
queueName=default
oozieRoot=user/${user.name}/oozie
oozie.wf.application.path=${nameNode}/${oozieRoot}/apps/ssh$ cat oozie/apps/ssh/workflow.xml
<workflow-app xmlns="uri:oozie:workflow:1.0" name="ssh-wf">
<start to="ssh-node"/>
<action name="ssh-node">
<ssh xmlns="uri:oozie:ssh-action:0.1">
<host>localhost</host>
<command>~/work/oozie-5.2.1/oozie/apps/ssh/mushishi.sh</command>
<args>"Ginko"</args>
<capture-output/>
</ssh>
<ok to="check-output"/>
<error to="fail"/>
</action>
<decision name="check-output">
<switch>
<case to="end">
${wf:actionData('ssh-node')['Mushishi'] eq 'Ginko'}
</case>
<default to="fail-output"/>
</switch>
</decision>
<kill name="fail-output">
<message>Incorrect output, expected [Ginko] but was [${wf:actionData('ssh-node')['Mushishi']}]</message>
</kill>
<kill name="fail">
<message>SSH action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
</workflow-app>2) test the script
## run locally
$ ~/work/oozie-5.2.1/oozie/apps/ssh/mushishi.sh anonymous
Mushishi=anonymous
$ cat /tmp/mushishi_*.txt
anonymous /Library/Java/JavaVirtualMachines/jdk1.8.0_321.jdk/Contents/Home
## run remotely
$ ssh localhost ~/work/oozie-5.2.1/oozie/apps/ssh/mushishi.sh anonymous
Mushishi=anonymous
$ cat /tmp/mushishi_*.txt
anonymous
## Note: environment variables are missing on remote
3) run by oozie
## Note: it doesn't need to upload to hdfs
## submit and run
$ bin/oozie job -config oozie/apps/ssh/job.properties -run
job: 0000000-220713195559163-oozie-sun_-W
## check result
$ bin/oozie job -info 0000000-220713195559163-oozie-sun_-W
Job ID : 0000000-220713195559163-oozie-sun_-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : ssh-wf
App Path : hdfs://localhost:9000/user/sun_xo/oozie/apps/ssh
Status : SUCCEEDED
Run : 0
User : sun_xo
Group : -
Created : 2022-07-13 12:37 GMT
Started : 2022-07-13 12:37 GMT
Last Modified : 2022-07-13 12:37 GMT
Ended : 2022-07-13 12:37 GMT
CoordAction ID: -
Actions
------------------------------------------------------------------------------------------------------------------------------------
ID Status Ext ID Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
[email protected]:start: OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK 59990 OK -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK - end -
------------------------------------------------------------------------------------------------------------------------------------
[email protected] OK - OK -
------------------------------------------------------------------------------------------------------------------------------------
$ cat /tmp/mushishi_*.txt
Ginko
边栏推荐
- Uncaught syntaxerror: unexpected token '< is reported on the blank page of the H5 uniapp package‘
- Frustratingly Simple Few-Shot Object Detection
- gdb+vscode进行调试6——gdb调试多线程命令札记
- 关于1000BASE-T1 1000BASE-TX和100BASE-T1
- VIM 配置文件
- 随机森林的理解
- Hands on deep learning -- multi layer perceptron (MLP)
- Allegro Design Entry CIS 和 Orcad Capture CIS 关系
- Fair Attribute Classification through Latent Space De-biasing
- 频率派和贝叶斯派
猜你喜欢

Fisher线性判别分析Fisher Linear Distrimination

Fairness in Semi-supervised Learning: Unlabeled Data Help to Reduce Discrimination

PCA主成分分析(降维)过程推导
![[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

ResNet

【白话模电1】PN结与二极管

Labelme正常启动,但无法打开

One vs One Mitigation of Intersectional Bias

Powerful chart component library scottplot

动手学深度学习--线性神经网络篇
随机推荐
03 design of urban road dedusting and cooling system based on ZigBee
[literature reading] isl: an integer set library for the polygonal model
VIM profile
电解电容特性及应用要点
gdb+vscode进行调试8——使用core分析死循环、死锁、段错误
06 design of smart electronic medicine box based on stm32
AURIX Development Studio安装
[translation] transformers in computer vision
Monitor browser return operation - prohibit returning to the previous page
bais mintigation post-processing for individual and group fairness
Zeno paradox 2 Achilles and tortoise
04 design of indoor wireless positioning system based on ZigBee
动手学深度学习--多层感知机篇(MLP)
Hue Oozie Editor 调度 shell
Owl Eyes: Spotting UI Display Issues via Visual Understanding
捉虱子的博弈论
gdb+vscode进行调试7——程序出现segmentation default/段错误,如何进行调试?
IEEE754标准浮点数格式
02基于ZigBee的智能家居系统设计
【白话模电1】PN结与二极管