我在oozie工作流中运行了一些名为wf1的操作AC1的代码。此工作流未计划,但连续运行..通常情况下,action AC1一天会有4次轮换。此操作运行的时间以前是未知的。现在,还有另一个Oozie工作流WF2,计划在凌晨4:00使用Oozie协调器运行。这个WF2只运行3-4分钟,因为这是一个需要在非高峰时间运行的小代码。在此WF2中,我们希望检查工作流操作AC1 (作为WF1的一部分运行)的状态。每次AC1实例运行时,都会为其分配一个新的id。是否可以在不知道id的情况下,仅使用名称获取AC1的状态?
我知道我有一个解决办法,我可以将AC1的状态存储在配置单元表中,并不断查询相同的内容以了解状态。但是,如果提供了开箱即用的东西,它将是有帮助的。
发布于 2019-05-10 05:13:44
有几种方法可以做到这一点(正如你所提到的)。
内置的方法是使用job information,这样您就可以执行一个简单的get和get响应,其中包含所有操作的作业状态。在下面的示例中,您可以转到actions查找您的操作名称,并更改status,例如:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
.
{
id: "0-200905191240-oozie-W",
appName: "indexer-workflow",
appPath: "hdfs://user/bansalm/indexer.wf",
externalId: "0-200905191230-oozie-pepe",
user: "bansalm",
status: "RUNNING",
conf: "<configuration> ... </configuration>",
createdTime: "Thu, 01 Jan 2009 00:00:00 GMT",
startTime: "Fri, 02 Jan 2009 00:00:00 GMT",
endTime: null,
run: 0,
actions: [
{
id: "0-200905191240-oozie-W@indexer",
name: "AC1",
type: "map-reduce",
conf: "<configuration> ...</configuration>",
startTime: "Thu, 01 Jan 2009 00:00:00 GMT",
endTime: "Fri, 02 Jan 2009 00:00:00 GMT",
status: "OK",
externalId: "job-123-200903101010",
externalStatus: "SUCCEEDED",
trackerUri: "foo:8021",
consoleUrl: "http://foo:50040/jobdetailshistory.jsp?jobId=...",
transition: "reporter",
data: null,
errorCode: null,
errorMessage: null,
retries: 0
},https://stackoverflow.com/questions/54629840
复制相似问题