1

Is there a way to make and external call once a worflow is completed in Oozie. Reading some documentation it seems like possible. (Oozie can make HTTP callback notifications on action start/end/failure events and workflow end/failure events.)

http://archive.cloudera.com/cdh/3/oozie/WorkflowFunctionalSpec.html

But not sure how to do it and can it be an external api call on callback.

Thanks

4

2 回答 2

0

在文档的下方,第 5 节

外部 API 调用是什么意思?它只能执行 HTTP 获取 - 因此,如果您配置 servlet 端点或类似的东西以在访问 URL 时触发该外部 API 调用,那么您应该能够做几乎任何您想做的事情。

然而,值得注意的是,文档说:

Oozie 将尽最大努力传递通知,如果失败,它将在放弃之前以预先配置的间隔重试通知预先配置的次数。

于 2013-02-02T13:56:44.453 回答
0

您可以将两个属性添加到您的 oozie job.properties。变量 $jobId 、 $status 和 $nodeName 在运行时被替换。

1. oozie.wf.workflow.notification.url=http://yourserver.com/some/path/$jobId/$status

例如,这将为您在工作级别的http://yourserver.com/some/path/上为每个状态更改提供 HTTP GET 调用

myhost.softlayer.com - - [19/Feb/2016 10:35:02] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/RUNNING HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:35] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/SUCCEEDED HTTP/1.1" 200 -

这一个在您的 oozie 工作步骤之间提供了更详细的过渡

2. oozie.wf.action.notification.url=http://yourserver.com/some/path/$jobId/$nodeName/$status

服务器端的示例输出:

myhost.softlayer.com - - [19/Feb/2016 10:35:02] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/:start:/T:ReadConfig HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:03] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/ReadConfig/S:RUNNING HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:09] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/ReadConfig/T:CheckStep HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:10] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/sqoop-table-import/S:RUNNING HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:10] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/CheckStep/T:sqoop-table-import HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:29] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/javaStatsReporting/S:RUNNING HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:29] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/sqoop-table-import/T:javaStatsReporting HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:35] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/end/T:null HTTP/1.1" 200 -
myhost.softlayer.com - - [19/Feb/2016 10:35:35] "GET /dbgen/lineitem2/0000050-151213000221460-oozie-oozi-W/javaStatsReporting/T:end HTTP/1.1" 200 -
于 2016-02-19T16:50:06.657 回答