400错误的请求正在执行oozie作业

时间:2019-03-06 10:31:34

标签: hadoop oozie cloudera-cdh oozie-workflow

我正在尝试通过其Web服务API(Oozie 4.1.0-cdh5.15.2)执行Oozie作业。以前,此作业是通过Oozie命令行API成功执行的,大多数参数都作为命令参数提供。

workflow.xml当前位于HDFS上,因此我只是尝试以documentation中指定的XML格式发送作业属性:

POST /oozie/v1/jobs
Content-Type: application/xml;charset=UTF-8
.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>oozie.use.system.libpath</name>
        <value>true</value>
    </property>
    <property>
        <name>oozie.credentials.skip</name>
        <value>true</value>
    </property>
    <property>
        <name>oozie.wf.application.path</name>
        <value>hdfs://myownhdfs.com:8020/path/to/oozie/workflow/workflow.xml</value>
    </property>
    <property>
        <name>jobTracker</name>
        <value>myownhdfs.com:8032</value>
    </property>
    <property>
        <name>nameNode</name>
        <value>hdfs://myownhdfs.com:8020</value>
    </property>
    <property>
        <name>customScripts</name>
        <value>/nfs/path/to/scripts</value>
    </property>
</configuration>

我的工作流程.xml

<?xml version="1.0" encoding="UTF-8"?>
<workflow-app
        xmlns="uri:oozie:workflow:0.5"
        name="wf-check">
    <global>
        <job-tracker>${jobTracker}</job-tracker>
        <name-node>${nameNode}</name-node>
    </global>
    <start to="py-check" />
    <action name="py-check">
        <python xmlns="uri:oozie:custom-python-action:0.1">
            <custom-scripts>${customScripts}</custom-scripts>
            <script>foo/bar/myscript.py</script>
            <debug-sleep-begin>0</debug-sleep-begin>
            <debug-sleep-end>0</debug-sleep-end>
            <log-level>DEBUG</log-level>
            <capture-output />
        </python>
        <ok to="end" />
        <error to="fail" />
    </action>
    <kill name="fail">
        <message>Python failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <end name="end" />
</workflow-app>

但是我只收到 400错误的请求:客户端发送的请求在语法上是错误的。

有人暗示我做错了什么吗?

1 个答案:

答案 0 :(得分:0)

我用curl执行了相同的请求(以前我在用Java的URLConnection进行测试),并在响应中找到2个标头,这些标头提供了有关错误的更多有用信息: oozie-error-code oozie-error-message 。第二个也包含错误代码,因此无需将它们都记录下来。

HTTP/1.1 400 Bad Request
...
oozie-error-code: E0504
oozie-error-message: E0504: App directory [/foo/bar] does not exist