【发布时间】:2017-10-16 14:21:14
【问题描述】:
我正在使用 REST api 将 HIVE 作业提交给 oozie。 我尝试使用邮递员和 curl 发送请求,但我收到一条错误消息:“此请求需要 HTTP 身份验证。”
我尝试在 Cloudera 快速入门和 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 - 错误报告HTTP 状态 401 -
type 状态报告
消息
说明此请求需要HTTP身份验证。
Apache Tomcat/6.0.44
在不添加额外授权的情况下运行 GET 请求时,我得到了响应
curl -X GET "http://localhost:11000/oozie/v1/admin/status"
和响应:{"systemMode":"NORMAL"}
我错过了什么? 我应该如何通过 oozie REST api 提交 oozie hive 作业?
谢谢
【问题讨论】:
标签: hadoop authentication oozie cloudera-cdh