本文介绍了Oozie协调器,以sysdate作为开始时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以开始时间为sysdate运行oozie协调器.我该怎么办?
是否可以将sysdate作为开始日期?会赶上吗?

I want to run oozie coordinator with start time as sysdate. How do I do that?
is it possible to put sysdate as start date ? Will it catch up?

推荐答案

您可以使coorodinator的"start"引用变量-startTime,然后从命令行使用sysdate覆盖其值,例如:

You can make coorodinator's "start" refer to a variable - startTime, then overwrite its value with sysdate from command line, such as:

 oozie job -run -config ./coord.properties -DstartTime=`date -u "+%Y-%m-%dT%H:00Z"`

如果您在系统中未使用UTC时区,请调整时间格式.

adjust the time format if you are not using UTC time zone in your system.

示例协调器作业xml:

sample coordinator job xml:

<coordinator-app name="my-coord"
    frequency="${frequency}" start="${startTime}" end="${end}" timezone="UTC"
    xmlns="uri:oozie:coordinator:0.4">
    <action>
            <workflow> ...

协调器属性文件coord.properties:

coordinator attribute file coord.properties:

...
startTime=2014-05-19T22:00Z
end=2015-01-19T22:08Z
frequency=60 ...

这篇关于Oozie协调器,以sysdate作为开始时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 06:55