Oozie shell 操作:exec 和文件标签

Oozie shell action: exec and file tags

我是 Oozie 的新手,我读过一些 Oozie shell 动作示例,但这让我对某些事情感到困惑。

我见过一些没有 <file> 标签的例子。

一些例子,比如 Cloudera here,重复文件标签中的 shell 脚本:

<shell xmlns="uri:oozie:shell-action:0.2">
    <exec>check-hour.sh</exec>
    <argument>${earthquakeMinThreshold}</argument>
    <file>check-hour.sh</file>
</shell>

Oozie's website 中,写入 shell 脚本(来自 job.properties 的引用 ${EXEC},它指向 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 或本地?)在 <file> 标记内的 script.sh#script.sh 之前。

<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>

据我了解,任何 shell 脚本文件都可以包含在工作流 HDFS 路径中(与 workflow.xml 所在的路径相同)。

谁能解释一下这些示例中的差异以及如何使用 <exec><file>script.sh#script.sh/path/script.sh#script.sh

<file>hdfs:///apps/duh/mystuff/check-hour.sh</file> 表示 "download that HDFS file into the Current Working Dir of the YARN container that runs the Oozie Launcher for the Shell action, using the same file name by default, so that I can reference it as ./check-hour.sh or simply check-hour.sh in the <exec> element".

<file>check-hour.sh</file>表示"download that HDFS file -- from my user's home dir e.g. hdfs:///user/borat/check-hour.sh -- into etc. etc.".

<file>hdfs:///apps/duh/mystuff/check-hour.sh#youpi</file>表示"download that HDFS file etc. etc., renaming it as youpi, so that I can reference it as ./youpi or simply youpi in the element".

请注意,Hue UI 经常会插入不必要的 # 内容,而不会实际更改名称。这就是为什么你会经常看到它。