Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oozie coordinator with sysdate as start time

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?

like image 242
user2800129 Avatar asked Dec 03 '14 03:12

user2800129


People also ask

How is an Oozie coordinator configured?

When a coordinator job is submitted, Oozie parses the coordinator job XML. Oozie then creates a record for the coordinator with status PREP and returns a unique ID. The coordinator is also started immediately if the pause time is not set.

What is Coord nominalTime ()?

As I understood, the function coord:nominalTime() should return the nominal_time based on the start time and frequency.


1 Answers

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

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

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

coordinator attribute file coord.properties:

...
startTime=2014-05-19T22:00Z 
end=2015-01-19T22:08Z   
frequency=60 ...
like image 140
Paul H. Avatar answered Oct 13 '22 10:10

Paul H.