메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


1. coordinator.xml에서 아래와 같이 <datasets></datasets>을 추가해주면 <done-flag></done-flag>사이에 지정된 파일이 <uri-template></uri-template>사이의 경로에 생성되어야만 action이 실행되도록 할 수 있다.

 

-----------------------------------------------------------------coordinator.xml-------------------------------------------------------------------------------------

<coordinator-app name="${scenarioNo}-s-C" frequency="${coord:minutes(1)}" start="${startTime}" end="${endTime}"
timezone="UTC" xmlns="uri:oozie:coordinator:0.1">
    <controls>
     <concurrency>1</concurrency>
    </controls>

    <datasets>
         <dataset name="logs" frequency="${coord:minutes(1)}"
                initial-instance="${startTime}" timezone="UTC">
            <uri-template>
                ${nameNode}/data1/cas/output/s1/${YEAR}/${MONTH}/${DAY}
            </uri-template>
         <done-flag>000000_0</done-flag>
     </dataset>
    </datasets>
    <input-events>
      <data-in name="input" dataset="logs">
         <instance>${startTime2}</instance>
      </data-in>
    </input-events>

    <action>
      <workflow>
         <app-path>${nameNode}/data1/cas/scenario/${scenarioNo}/sqoop</app-path>
         <configuration>
            <property>
                <name>jobTracker</name>
                <value>${jobTracker}</value>
            </property>
            <property>
                <name>nameNode</name>
                <value>${nameNode}</value>
            </property>
            <property>
                <name>queueName</name>
                <value>${queueName}</value>
            </property>
            <property>
                <name>wfInput</name>
                <value>${coord:dataIn('input')}</value>
            </property>
            <property>
                <name>iyear</name>
                <!-- <value>${coord:formatTime(coord:nominalTime(),"yyyy")}</value> -->
                <value>${coord:formatTime(coord:actualTime(),"yyyy")}</value>
            </property>
            <property>
                <name>imonth</name>
                <!-- <value>${coord:formatTime(coord:nominalTime(),"MM")}</value> -->
                <value>${coord:formatTime(coord:actualTime(),"MM")}</value>
            </property>
            <property>
                <name>iday</name>
                <!-- <value>${coord:formatTime(coord:nominalTime(),"dd")}</value> -->
                <value>${coord:formatTime(coord:actualTime(),"dd")}</value>
            </property>
          </configuration>
      </workflow>
    </action>
</coordinator-app>

위로