分享

oozie input-events和datasets任务一直等待状态

Joker 发表于 2015-11-18 19:58:18 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 4 14034
使用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]



谢谢


已有(4)人评论

跳转到指定楼层
jixianqiuxue 发表于 2015-11-18 21:12:02
一个Coordinator 动作的状态集合,如下所示:

  • WAITING
  • READY
  • SUBMITTED
  • TIMEDOUT
  • RUNNING
  • KILLED
  • SUCCEEDED
  • FAILED

WAITING说明程序卡在了最初始的阶段



回复

使用道具 举报

jixianqiuxue 发表于 2015-11-18 21:19:40
建议楼主参考这个篇,最后也有个配置文件。跟楼主的有所区别。可以试试,希望对楼主有所帮助
值得一看:Oozie Coordinator使用及详解
http://www.aboutyun.com/thread-7721-1-1.html



回复

使用道具 举报

Joker 发表于 2015-11-19 16:44:45
jixianqiuxue 发表于 2015-11-18 21:19
建议楼主参考这个篇,最后也有个配置文件。跟楼主的有所区别。可以试试,希望对楼主有所帮助
值得一看:Oo ...

<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>
我有该标签包裹啊,如果不为这个路径是需要等待,我设定每天跑一次任务但是,我通过datasets标签的frequency元素进行轮询查看数据路径是否生成成功。成功就应该执行我的workflow,xml
中的Hive了,现在问题是frequency元素属性每分钟轮询,假设路径存在,但是没有启动执行任务啊!
回复

使用道具 举报

jixianqiuxue 发表于 2015-11-21 15:45:32
Joker 发表于 2015-11-19 16:44
hdfs://hostname:9000/user/hadoop/xxx/xxx/reportDat ...

建议先弄个简单的,先能执行,然后慢慢添加,找到到底哪里出错了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条