分享

oozie执行hive示例报错,求大神帮忙

zayliu1 发表于 2014-5-14 14:37:03 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 10 68508
问题描述:
在用oozie测试调用安装包中自带hive示例时报错:
操作步骤如下:
hadoop 版本为1.0.3、oozie 版本为3.3.0 、hive 版本为0.9.0
hadoop 、hive 、oozie 都以安装好,服务也以全部启动
开始测试oozie 调用hive action
修改oozie 安装包自带的examples 示例中的hive 配置文件
配置信息如下
1.job.properties 文件
这个文件,我只修改了namenode 和jobTracker 属性值

nameNode=hdfs://ha-test-nn:8020
jobTracker=ha-test-jt:54311
queueName=default
examplesRoot=examples
oozie.use.system.libpath=true
oozie.wf.application.path=${nameNode}/user/${user.name}/${examplesRoot}/apps/hive

2.webflow.xml 文件
在configuration 属性中添加了oozie.hive.defaults、 hive.metastore.uris、hive.metastore.local、hive.metastore.warehouse.dir、hive.metastore.local几个属性。在网上查的说要添加这个几个属性,这个几个属性我都是hive 的 hive-site.xml文件中复制过来的。

<workflow-app xmlns="uri:oozie:workflow:0.2" name="hive-wf">
    <start to="hive-node"/>
    <action name="hive-node">
        <hive xmlns="uri:oozie:hive-action:0.2">
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <prepare>
                <delete path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data/hive"/>
                <mkdir path="${nameNode}/user/${wf:user()}/${examplesRoot}/output-data"/>
            </prepare>
            <configuration>
                <property>
                    <name>mapred.job.queue.name</name>
                    <value>${queueName}</value>
                </property>
    <property>  
     <name>oozie.hive.defaults</name>  
     <value>hive-site.xml</value>  
    </property>
    <property>
     <name>hive.metastore.uris</name>
     <value>thrift://ha-test-nn:9083</value>
      </property>
      <property>
     <name>hive.metastore.local</name>
      <value>false</value>
    </property>
    <property>
      <name>hive.metastore.warehouse.dir</name>
      <value>/user/hive/warehouse</value>
    </property>
    <property>
       <name>hive.metastore.local</name>
       <value>false</value>
    </property>
            </configuration>
            <script>script.q</script>
            <param>INPUT=/user/${wf:user()}/${examplesRoot}/input-data/table</param>
            <param>OUTPUT=/user/${wf:user()}/${examplesRoot}/output-data/hive</param>
        </hive>
        <ok to="end"/>
        <error to="fail"/>
    </action>
    <kill name="fail">
        <message>Hive failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end"/>
</workflow-app>

3.script.q 文件
这个文件内容没改
CREATE EXTERNAL TABLE test_liuz (a INT) STORED AS TEXTFILE LOCATION '${INPUT}';
INSERT OVERWRITE DIRECTORY '${OUTPUT}' SELECT * FROM test_liuz;

4.将hive 安装目录下hive-site.xml 直接拿过来的放在 和workflow.xml 文件相同的目录
网上说要oozie 掉hive 要指定hive-site.xml ,索性直接把文件拿过来。。。。

5.接着开始测试
将examples 整个目录上传hdfs 上
我这边上传的目录为 hadoop fd -copyFromLocal home/hddtmn/liuz/examples  /user/hddtmn/examples

  执行提交oozie job
  bin/oozie job -oozie http://localhost://11000/oozie -config /home/hddtmn/liuz/examples/app/hive/job.properties -run

  提交后发现失败了,info 和 log信息如下

hddtmn@bB0203007:~> /usr/lib/oozie/bin/oozie job -oozie http://localhost:11000/oozie -info 0000020-140401110935084-oozie-oozi-W
Job ID : 0000020-140401110935084-oozie-oozi-W
------------------------------------------------------------------------------------------------------------------------------------
Workflow Name : hive-wf
App Path      : hdfs://ha-test-nn:8020/user/hddtmn/examples/apps/hive
Status        : KILLED
Run           : 0
User          : hddtmn
Group         : -
Created       : 2014-05-14 06:03 GMT
Started       : 2014-05-14 06:03 GMT
Last Modified : 2014-05-14 06:03 GMT
Ended         : 2014-05-14 06:03 GMT
CoordAction ID: -
Actions
------------------------------------------------------------------------------------------------------------------------------------
ID                                                                            Status    Ext ID                 Ext Status Err Code
------------------------------------------------------------------------------------------------------------------------------------
0000020-140401110935084-oozie-oozi-W@:start:                                  OK        -                      OK         -
------------------------------------------------------------------------------------------------------------------------------------
0000020-140401110935084-oozie-oozi-W@hive-node                                ERROR     job_201404020957_0114  FAILED/KILLED9
------------------------------------------------------------------------------------------------------------------------------------
0000020-140401110935084-oozie-oozi-W@fail                                     OK        -                      OK         E0729
------------------------------------------------------------------------------------------------------------------------------------



hddtmn@bB0203007:~> /usr/lib/oozie/bin/oozie job -oozie http://localhost:11000/oozie -log 0000020-140401110935084-oozie-oozi-W
2014-05-14 14:03:08,675  INFO ActionStartXCommand:539 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@:start:] Start action [0000020-140401110935084-oozie-oozi-W@:start:] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2014-05-14 14:03:08,676  WARN ActionStartXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@:start:] [***0000020-140401110935084-oozie-oozi-W@:start:***]Action status=DONE
2014-05-14 14:03:08,676  WARN ActionStartXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@:start:] [***0000020-140401110935084-oozie-oozi-W@:start:***]Action updated in DB!
2014-05-14 14:03:08,745  INFO ActionStartXCommand:539 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] Start action [0000020-140401110935084-oozie-oozi-W@hive-node] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2014-05-14 14:03:10,080  WARN HiveActionExecutor:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] credentials is null for the action
2014-05-14 14:03:19,098  INFO HiveActionExecutor:539 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] checking action, external ID [job_201404020957_0114] status [RUNNING]
2014-05-14 14:03:19,100  WARN ActionStartXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] [***0000020-140401110935084-oozie-oozi-W@hive-node***]Action status=RUNNING
2014-05-14 14:03:19,101  WARN ActionStartXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] [***0000020-140401110935084-oozie-oozi-W@hive-node***]Action updated in DB!
2014-05-14 14:03:34,355  INFO CallbackServlet:539 - USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] callback for action [0000020-140401110935084-oozie-oozi-W@hive-node]
2014-05-14 14:03:34,418  INFO HiveActionExecutor:539 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] action completed, external ID [job_201404020957_0114]
2014-05-14 14:03:34,448  WARN HiveActionExecutor:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [9]
2014-05-14 14:03:34,537  INFO ActionEndXCommand:539 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@hive-node] ERROR is considered as FAILED for SLA
2014-05-14 14:03:34,585  INFO ActionStartXCommand:539 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@fail] Start action [0000020-140401110935084-oozie-oozi-W@fail] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2014-05-14 14:03:34,585  WARN ActionStartXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@fail] [***0000020-140401110935084-oozie-oozi-W@fail***]Action status=DONE
2014-05-14 14:03:34,585  WARN ActionStartXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[0000020-140401110935084-oozie-oozi-W@fail] [***0000020-140401110935084-oozie-oozi-W@fail***]Action updated in DB!
2014-05-14 14:03:34,646  WARN CoordActionUpdateXCommand:542 - USER[hddtmn] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000020-140401110935084-oozie-oozi-W] ACTION[-] E1100: Command precondition does not hold before execution, [, coord action is null], Error Code: E1100

log 其中有一行信息 Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [9],这个地方有错误?
折腾了N久,未解决,求大神指导啊



已有(11)人评论

跳转到指定楼层
hyj 发表于 2014-5-14 15:31:47
没有接触过这方面,但是你应该是调度方面的出错了
  1. Command precondition does not hold before execution, [, coord action is null], Error Code: E1100
复制代码



回复

使用道具 举报

zayliu1 发表于 2014-5-14 15:41:00
hyj 发表于 2014-5-14 15:31
没有接触过这方面,但是你应该是调度方面的出错了

您好,调度方面是指哪里,我用oozie 调度mr 可以正常执行,难道是hive 的配置问题?
回复

使用道具 举报

sstutu 发表于 2014-5-14 16:48:16
zayliu1 发表于 2014-5-14 15:41
您好,调度方面是指哪里,我用oozie 调度mr 可以正常执行,难道是hive 的配置问题?

你的hive能正常使用吗?如果正常的话,你需要看看它们的结合点
回复

使用道具 举报

zayliu1 发表于 2014-5-14 17:08:03
sstutu 发表于 2014-5-14 16:48
你的hive能正常使用吗?如果正常的话,你需要看看它们的结合点

您好,hive可以使用,一下我随便建了个表,没问题
hive> create table test_liu1(id int);
OK
Time taken: 0.324 seconds
hive> select * from test_liu1;
OK
Time taken: 0.472 seconds

它们的结合点是什么哦?


点评

那就是有oozie的配置问题了。你通过oozie执行hive,它们之间肯定有关联吧。  发表于 2014-5-14 17:13
回复

使用道具 举报

zayliu1 发表于 2014-5-14 17:48:27
zayliu1 发表于 2014-5-14 17:08
您好,hive可以使用,一下我随便建了个表,没问题
hive> create table test_liu1(id int);
OK

有关联,暂时不知道原理,感觉应该是通过配置中的hive-site.xml 文件关联的,现在不知道从何下手处理了
回复

使用道具 举报

sstutu 发表于 2014-5-14 20:32:50
只能查找资料,靠个人猜想和实验了
回复

使用道具 举报

zayliu1 发表于 2014-5-15 09:37:04
回复

使用道具 举报

fniks 发表于 2014-7-7 15:25:00
我的情况跟你差不多,问题解决了吗,我的LOG:
2014-07-07 15:06:30,962  WARN HiveActionExecutor:542 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@hive-node] Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [40000]
2014-07-07 15:06:31,003  INFO ActionEndXCommand:539 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@hive-node] end executor for wf action 0000005-140707141440188-oozie-oozi-W with wf job 0000005-140707141440188-oozie-oozi-W
2014-07-07 15:06:31,073  INFO ActionEndXCommand:539 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@hive-node] ERROR is considered as FAILED for SLA
2014-07-07 15:06:31,191  INFO ActionStartXCommand:539 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@fail] Start action [0000005-140707141440188-oozie-oozi-W@fail] with user-retry state : userRetryCount [0], userRetryMax [0], userRetryInterval [10]
2014-07-07 15:06:31,192  WARN ActionStartXCommand:542 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@fail] [***0000005-140707141440188-oozie-oozi-W@fail***]Action status=DONE
2014-07-07 15:06:31,192  WARN ActionStartXCommand:542 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@fail] [***0000005-140707141440188-oozie-oozi-W@fail***]Action updated in DB!
2014-07-07 15:06:31,234  INFO ActionEndXCommand:539 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[0000005-140707141440188-oozie-oozi-W@fail] end executor for wf action 0000005-140707141440188-oozie-oozi-W with wf job 0000005-140707141440188-oozie-oozi-W
2014-07-07 15:06:31,336  WARN CoordActionUpdateXCommand:542 - USER[hive] GROUP[-] TOKEN[] APP[hive-wf] JOB[0000005-140707141440188-oozie-oozi-W] ACTION[-] E1100: Command precondition does not hold before execution, [, coord action is null], Error Code: E1100
回复

使用道具 举报

zayliu1 发表于 2014-7-22 17:13:51
解决,我的问题是 share 共享jar 包,没穿到hdfs 上所以报错了。

这里oozie 报错信息不好找,你需要找hadoop 对应的job 日志,看看job 日志里的具体报错信息,再看看怎么处理了
回复

使用道具 举报

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

本版积分规则

关闭

推荐上一条 /2 下一条