我是Oozie的新手,我已经阅读了一些Oozie shell动作示例,但这使我对某些事情感到困惑。
我看到了一些没有<file>
标签的示例。
像在Cloudera此处这样的示例,重复文件标签中的shell脚本:
<shell xmlns="uri:oozie:shell-action:0.2">
<exec>check-hour.sh</exec>
<argument>${earthquakeMinThreshold}</argument>
<file>check-hour.sh</file>
</shell>
在Oozie的网站上,${EXEC}
两次编写shell脚本(来自job.properties的引用,该引用指向script.sh文件),两次之间用#分隔。
<shell xmlns="uri:oozie:shell-action:0.1">
...
<exec>${EXEC}</exec>
<argument>A</argument>
<argument>B</argument>
<file>${EXEC}#${EXEC}</file>
</shell>
我也看到了一些示例,其中路径(HDFS还是本地?)script.sh#script.sh
在<file>
标记之前位于哪个位置。
<shell xmlns="uri:oozie:shell-action:0.1">
...
<exec>script.sh</exec>
<argument>A</argument>
<argument>B</argument>
<file>/path/script.sh#script.sh</file>
</shell>
据我了解,任何外壳程序脚本文件都可以包含在工作流HDFS路径中(workflow.xml所在的路径相同)。
有人能解释这些例子中的差异,以及如何<exec>
,<file>
,script.sh#script.sh
,和/path/script.sh#script.sh
使用?
<file>hdfs:///apps/duh/mystuff/check-hour.sh</file>
意味着“将HDFS文件下载到运行Oozie Launcher for Shell动作的YARN容器的当前工作目录中,默认情况下使用相同的文件名,以便我可以在<exec>元素中引用它,./check-hour.sh
也可以简单地check-hour.sh
在<exec>元素中引用它。”。
<file>check-hour.sh</file>
意思是“从用户的主目录(例如)下载HDFS文件hdfs:///user/borat/check-hour.sh
到等,等等。” 。
<file>hdfs:///apps/duh/mystuff/check-hour.sh#youpi</file>
表示“下载该HDFS文件等,等等,将其重命名为youpi
,这样我就可以在元素中引用它./youpi
或简单地youpi
在元素中引用它”。
请注意,Hue UI通常会插入不需要的#
名称,而无需更改实际名称。这就是为什么您会经常看到它的原因。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句