Falcon&Oozie-如何在Falcon中为Oozie配置job.properties

Falcon&Oozie-如何在Falcon中为Oozie配置job.properties,properties,workflow,config,oozie,falcon,Properties,Workflow,Config,Oozie,Falcon,我有一个oozie工作流,它调用sqoop和hive操作。当我从命令行运行oozie时,这个单独的工作流工作得很好。 由于sqoop和配置单元脚本不同,我使用job.properties文件将值传递给workflow.xml sudooozie作业-oozie-config job.properties-run 现在我想在Falcon中配置这个oozie工作流。您能帮我弄清楚在哪里可以配置或传递作业。属性 下面是falcon process.xml <process name="demoP

我有一个oozie工作流,它调用sqoop和hive操作。当我从命令行运行oozie时,这个单独的工作流工作得很好。 由于sqoop和配置单元脚本不同,我使用job.properties文件将值传递给workflow.xml

sudooozie作业-oozie-config job.properties-run

现在我想在Falcon中配置这个oozie工作流。您能帮我弄清楚在哪里可以配置或传递作业。属性

下面是falcon process.xml

<process name="demoProcess" xmlns="uri:falcon:process:0.1">
<tags>pipeline=degIngestDataPipeline,owner=hadoop, externalSystem=svServers</tags>
<clusters>
    <cluster name="demoCluster">
        <validity start="2015-01-30T00:00Z" end="2016-02-28T00:00Z"/>
    </cluster>
</clusters>
<parallel>1</parallel>
<order>FIFO</order>
<frequency>hours(1)</frequency>
<outputs>
    <output name="output" feed="demoFeed" instance="now(0,0)" />
</outputs>

<workflow name="dev-wf" version="0.2.07"
engine="oozie" path="/apps/demo/workflow.xml" />

<retry policy="periodic" delay="minutes(15)" attempts="3" />
</process>

我在网上或falcon文档中找不到关于这方面的太多帮助。

我在falcon进行了一些开发,但没有经常尝试falcon vanilla,但从以下教程中我了解到:

我将尝试创建oozie-workflow.xml,它动态地接受job.properties。将属性文件放在相应的HDFS文件夹中,workflow.xml从中提取属性文件,您可以为每个流程更改属性文件。现在,您可以使用falcon process.xml并使用以下命令行调用它:

falcon实体-类型进程-提交-文件process.xml

<process name="demoProcess" xmlns="uri:falcon:process:0.1">
<tags>pipeline=degIngestDataPipeline,owner=hadoop, externalSystem=svServers</tags>
<clusters>
    <cluster name="demoCluster">
        <validity start="2015-01-30T00:00Z" end="2016-02-28T00:00Z"/>
    </cluster>
</clusters>
<parallel>1</parallel>
<order>FIFO</order>
<frequency>hours(1)</frequency>
<outputs>
    <output name="output" feed="demoFeed" instance="now(0,0)" />
</outputs>

<workflow name="dev-wf" version="0.2.07"
engine="oozie" path="/apps/demo/workflow.xml" />

<retry policy="periodic" delay="minutes(15)" attempts="3" />
</process>
此外,在path=/apps/demo/workflow.xml中,您不需要显式指定workflow.xml。您可以只提供文件夹名称,例如:

<process name="rawEmailIngestProcess" xmlns="uri:falcon:process:0.1">

<tags>pipeline=churnAnalysisDataPipeline,owner=ETLGroup,externalSystem=USWestEmailServers</tags>


<clusters>
    <cluster name="primaryCluster">
        <validity start="2014-02-28T00:00Z" end="2016-03-31T00:00Z"/>
    </cluster>
</clusters>

<parallel>1</parallel>
<order>FIFO</order>
<frequency>hours(1)</frequency>

<outputs>
    <output name="output" feed="rawEmailFeed" instance="now(0,0)" />
</outputs>

<workflow name="emailIngestWorkflow" version="2.0.0"
engine="oozie" path="/user/ambari-qa/falcon/demo/apps/ingest/fs" />

<retry policy="periodic" delay="minutes(15)" attempts="3" />

再想一想,我觉得您可以创建一个带有shell操作的oozie来调用sqoop_hive.sh,其中包含以下代码行:

sudooozie作业-oozie-config job.properties-run

Workflow.xml看起来像:

<workflow-app xmlns="uri:oozie:workflow:0.4" name="shell-wf">
<start to="shell-node"/>
<action name="shell-node">
    <shell xmlns="uri:oozie:shell-action:0.2">
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
        <configuration>
            <property>
                <name>mapred.job.queue.name</name>
                <value>${queueName}</value>
            </property>
        </configuration>
        <exec>sqoop_hive.sh</exec>
        <argument>${feedInstancePaths}</argument>
        <file>${wf:appPath()}/sqoop_hive.sh#sqoop_hive.sh</file>
        <!-- <file>/tmp/ingest.sh#ingest.sh</file> -->
        <!-- <capture-output/> -->
    </shell>
    <ok to="end"/>
    <error to="fail"/>
</action>
<kill name="fail">
    <message>Shell action failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
</kill>
<end name="end"/>
使用falcon进程调用调用此函数,如下所示:

falcon实体类型process-submit-file process.xml。如果在oozie中创建一个shell操作,在shell脚本中调用oozie in命令行,则可以在本地更改job.properties