gpt4 book ai didi

hadoop - oozie REST api POST 新配置单元作业获取 "This request requires HTTP authentication."

转载 作者:可可西里 更新时间:2023-11-01 15:55:58 28 4
gpt4 key购买 nike

我正在使用 REST api 将 HIVE 作业提交给 oozie。我尝试使用 postman 和 curl 发送请求,但收到一条错误消息:“此请求需要 HTTP 身份验证。”

我尝试在我的 Cloudera quickstart 和 Hortonworks 上运行它,但遇到了同样的错误。

config.xml 是:

 <?xml version="2.0" encoding="UTF-8"?><configuration><property><name>fs.default.name</name><value>hdfs://localhost:8020</value></property><property><name>mapred.job.tracker</name><value>localhost:8021</value></property><property><name>user.name</name><value>cloudera</value></property><property><name>oozie.hive.script</name><value>select * from test;</value></property><property><name>oozie.libpath</name><value>hdfs://localhost:8020/user/cloudera/share/lib/hive</value></property><property><name>oozie.proxysubmission</name><value>true</value></property></configuration> 

curl 是:

 curl -X POST -H "Content-Type: application/xml" -d @config.xml http://localhost:11000/oozie/v1/jobs?action=start

我也试过这个:

curl -X POST -H "Content-Type: application/xml" -d @config.xml  --negotiate -u cloudera:cloudera //localhost:11000/oozie/v1/jobs?action=start

或者这个:

curl -X POST -H "Content-Type: application/xml" -d "fs.default.namehdfs://localhost:8020mapred.job.trackerlocalhost:8021user.nameclouderaoozie.hive.scriptselect * from test;oozie.libpathhdfs://localhost:8020/user/cloudera/share/lib/hiveoozie.proxysubmissiontrue"//localhost:11000/oozie/v2/job
(配置是正确的 xml 文件)

响应是:

Apache Tomcat/6.0.44 - Error report 

HTTP Status 401 -

type Status report

message

description This request requires HTTP authentication.

Apache Tomcat/6.0.44

在不添加额外授权的情况下运行 GET 请求时,我得到了响应

 curl -X GET "http://localhost:11000/oozie/v1/admin/status" 
和响应:
{"systemMode":"NORMAL"}

我错过了什么?我应该如何通过 oozie REST API 提交 oozie Hive 作业?

谢谢

最佳答案

我遇到了同样的问题。我的解决方案涉及修复 oozie.wf.application.path 参数值——它指向一个不存在的 workflow.xml 文件。将其更改为正确的文件名可解决问题。

我不得不承认 Oozie 的 API 消息在这种情况下不是很有帮助:This request requires HTTP authentication. m 在 Kerberized 集群上运行)。

因此,请仔细检查您的 job.xmlworkflow.xml 文件。

关于hadoop - oozie REST api POST 新配置单元作业获取 "This request requires HTTP authentication.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44019464/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com