您的位置:首页 > 其它

Oozie workflow工作流action间参数传递实现

2017-05-14 15:46 399 查看
假设workflow里有两个action节点,shell和hive,hive需要用到shell节点里的值,shell脚本如下

#!/bin/sh
day=`date '+%Y%m%d%H'`
echo "day:$day"


hive节点需传入day这个参数。需要用到shell节点里<capture-output/>这个属性,如下

<action name="shell-118a ">
<shell xmlns="uri:oozie:shell-action:0.1">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<configuration>
<property>
<name>mapred.job.queue.name</name>
<value>${queueName}</value>
</property>
</configuration>
<exec>${shell}</exec>
<file>${shell}#${shell}</file>
<capture-output/>
</shell>
<ok to="hive_node "/>
<error to="fail"/>
</action>
<action name="hive_node">
<hive xmlns="uri:oozie:hive-action:0.2">
<job-tracker>${jobTracker}</job-tracker>
<name-node>${nameNode}</name-node>
<job-xml>${apps_hdfs_home}/common/conf/hive-site.xml</job-xml>
<script>${sql}</script>
<param>day=${wf:actionData('shell-118a')['day']}</param>
</hive>
<ok to="end"/>
<error to="Kill"/>
</action>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: