Oozie shell动作:exec和文件标签

men*_*h84 2 oozie

我是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>
Run Code Online (Sandbox Code Playgroud)

Oozie的网站上,将shell脚本(${EXEC}来自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>
Run Code Online (Sandbox Code Playgroud)

还有一些例子我看过路径(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>
Run Code Online (Sandbox Code Playgroud)

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

有人能解释这些例子中的差异,以及如何<exec>,<file>,script.sh#script.sh,和/path/script.sh#script.sh使用?

Sam*_*ter 15

<file>hdfs:///apps/duh/mystuff/check-hour.sh</file>表示"将该HDFS文件下载到YARN容器的当前工作目录中,该容器运行Oozie Launcher以进行Shell操作,默认情况下使用相同的文件名,以便我可以引用它./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通常会插入不必要的#内容而不会更改实际名称.这就是为什么你会经常看到它.