使用oozie按照每小时调度,期间可能文件还没有收集到HDFS,这个时候才有Oozie轮询查看HDFS是否存在该文件标记为了测试找了有数据的文件,但是一直为WAITING状态
配置如下:
coordinator.xml
[mw_shl_code=xhtml,true]<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<coordinator-app name="wxforschool-coord" frequency="${coord:hours(1)}" start="${start}" end="${end}" timezone="UTC" xmlns="uri:oozie:coordinator:0.2">
<datasets>
<dataset name="hour" frequency="${coord:minutes(1)}"
initial-instance="2015-11-18T12:00+0800" timezone="UTC">
<uri-template>
hdfs://hostname:9000/user/hadoop/xxx/xxx/reportDate/reportHour
</uri-template>
<done-flag>_done</done-flag>
</dataset>
</datasets>
<input-events>
<data-in name="input" dataset="hour">
<start-instance>${coord:current(-1)}</start-instance>
<end-instance>${coord:current(0)}</end-instance>
</data-in>
</input-events>
<action>
<workflow>
<app-path>${workflowAppUri}</app-path>
<configuration>
<property>
<name>reportDate</name>
<value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), "yyyy-MM-dd")}</value>
</property>
<property>
<name>reportHour</name>
<value>${coord:formatTime(coord:dateOffset(coord:nominalTime(), -1, 'DAY'), "HH")}</value>
</property>
<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>
</configuration>
</workflow>
</action>
</coordinator-app>
[/mw_shl_code]
谢谢
|
|