400执行oozie作业的错误请求

7kqas0il  于 2021-05-27  发布在  Hadoop
关注(0)|答案(1)|浏览(493)

我试图通过它的web服务api(oozie4.1.0-cdh5.15.2)执行一个oozie作业。以前,这个作业是通过oozie命令行api成功执行的,大多数参数都作为命令参数提供。
workflow.xml当前在hdfs上,因此我只是尝试按文档中指定的格式以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个错误的请求:客户端发送的请求语法不正确。。
有人知道我会做错什么吗?

ej83mcc0

ej83mcc01#

我用curl执行了相同的请求(之前我是用java的urlconnection测试的),并在响应中找到了两个标头,它们提供了有关错误的更多有用信息:oozie错误代码和oozie错误消息。第二个还包含错误代码,因此不需要同时记录这两个错误。

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

相关问题