如何使用Oozie安排Squoop动作 [英] How to schedule a sqoop action using oozie
问题描述
我是Oozie的新手,我只是想知道-我如何使用Oozie安排一份临时工作.我知道可以在Oozie工作流程中添加sqoop动作.但是我该如何安排一个sqoop动作并使它像每天每2分钟或每天8pm一样自动运行(只是安排一个cron工作)?
I am new to Oozie, Just wondering - How do I schedule a sqoop job using Oozie. I know sqoop action can be added as part of the Oozie workflow. But how can I schedule a sqoop action and get it running like every 2 mins or 8pm every day automatically (just lie a cron job)?
推荐答案
您需要创建带有开始,结束和频率的coordinator.xml文件.这是一个例子
You need to create coordinator.xml file with start, end and frequency. Here is an example
<coordinator-app name="example-coord" xmlns="uri:oozie:coordinator:0.2"
frequency="${coord:days(7)}"
start="${start}"
end= "${end}"
timezone="America/New_York">
<controls>
<timeout>5</timeout>
</controls>
<action>
<workflow>
<app-path>${wf_application_path}</app-path>
</workflow>
</action>
</coordinator-app>
然后创建如下所示的coordinator.properties文件:
Then create coordinator.properties file like this one:
host=namenode01
nameNode=hdfs://${host}:8020
wf_application_path=${nameNode}/oozie/deployments/example
oozie.coord.application.path=${wf_application_path}
start=2013-07-13T07:00Z
end=2013-09-31T23:59Z
将您的coordinator.xml文件上传到hdfs,然后使用类似的内容提交您的协调器工作
Upload your coordinator.xml file to hdfs and then submit your coordinator job with something like
oozie job -config coordinator.properties -run
检查文档 http://oozie.apache.org/docs/3.3 .2/CoordinatorFunctionalSpec.html ,其中包含一些示例.
Check the documentation http://oozie.apache.org/docs/3.3.2/CoordinatorFunctionalSpec.html it contains some examples.
这篇关于如何使用Oozie安排Squoop动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!