代码之家  ›  专栏  ›  技术社区  ›  Vaya

通过HUE创建的Oozie工作流的Rest API

  •  1
  • Vaya  · 技术社区  · 10 年前

    我已经通过Hue界面创建了一个Oozie工作流。我有几个与此相关的问题

    a、 我可以看到创建的工作流XML。但我没有看到job.properties文件。Job.properties存储在哪里?

    b、 有REST API可以提交通过编写workflow.xml和job.properties创建的Oozie作业。对于通过HUE创建的Ouzie工作流,REST API是什么?任何样本都会有帮助。

    3 回复  |  直到 10 年前
        1
  •  5
  •   Vaya    10 年前

    我不想提出一个问题,然后回答它。但由于我必须找一个时间,答案可能会帮助某人。。。

    当使用Hue创建Oozie工作流时,Hue将创建工作流xml并将其放置在HDFS位置。稍后可以复制此文件并将其放置在HDFS中的任何位置。

    要使REST API调用oozie来启动工作流,以及workflow.xml,需要传递config.xml。为了获得要填充到config.xml中的值,我使用这种方法来查找详细信息。

    Submit the job via Hue. 
    Open the Oozie Web UI. (You can get the link from the Ambari. Click on oozie and look at the quick links at the top). 
    In the Oozie Web UI, the job that is executed will be shown in list view. 
    One of the tab is the Job Configuration. 
    The content of the Job Configuration will be the content in the config.xml that need to be passed along with the REST API.
    

    示例URL应为

    http://IP-where-Oozie-server-runs:11000/oozie/v1/jobs?action=start

    要启动的实际工作流位于config.xml中

      <property>
        <name>oozie.wf.application.path</name>
        <value>hdfs://Named-node-name:8020/location/to/workflow.xml </value>
      </property>
    

    问题仍然没有得到回答:是否有job.properties文件。看起来它不存在,也不是必需的。

    注意:正如romain所更新的,job.properties不存在,而是由POST正文内容替换。

        2
  •  1
  •   Romain    10 年前

    使用Oozie的REST API submitting a job 。如果您查看它,您将看到job.properties被替换为POST数据中的数据:

    例如

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <property>
            <name>user.name</name>
            <value>bansalm</value>
        </property>
    ....
    
        3
  •  0
  •   user7733412    8 年前

    属性和工作流文件都在工作区文件夹中