我需要http请求正文填充的帮助。 我正在做一个PUT http请求,我知道我做得对(在java中)。
我想运行简单的地图缩小工作示例 - 计算PI ... 当我使用命令时:
“hadoop jar /usr/hdp/2.2.0.0-2041/hadoop-mapreduce/hadoop-mapreduce-examples-2.6.0.2.0.0.0-2041.jar pi 10 10”
在hortonworks终端工作,我尝试创建并运行一个同样的工作。
我认为问题出在请求正文中(在run_mapreducer_M2.txt文件中)。 我试图使用YARN REST API。
我错过了什么?有人有一个使用简单MR工作的例子吗?
谢谢! 这是我用于请求正文的XML文件:
<application-submission-context>
<application-id>application_1421661392788_0005</application-id>
<application-name>pi2</application-name>
<queue>testqueue</queue>
<priority>3</priority>
<am-container-spec>
<environment>
<entry>
<key>CLASSPATH</key>
<value>/usr/hdp/2.2.0.0-2041/hadoop/conf<CPS>/usr/hdp/2.2.0.0-2041/hadoop/lib/*<CPS>/usr/hdp/2.2.0.0-2041/hadoop/.//*<CPS>/usr/hdp/2.2.0.0-2041/hadoop-hdfs/./<CPS>/usr/hdp/2.2.0.0-2041/hadoop-hdfs/lib/*<CPS>/usr/hdp/2.2.0.0-2041/hadoop-hdfs/.//*<CPS>/usr/hdp/2.2.0.0-2041/hadoop-yarn/lib/*<CPS>/usr/hdp/2.2.0.0-2041/hadoop-yarn/.//*<CPS>/usr/hdp/2.2.0.0-2041/hadoop-mapreduce/lib/*<CPS>/usr/hdp/2.2.0.0-2041/hadoop-mapreduce/.//*<CPS><CPS>/usr/share/java/mysql-connector-java-5.1.17.jar<CPS>/usr/share/java/mysql-connector-java.jar<CPS>/usr/hdp/current/hadoop-mapreduce-client/*<CPS>/usr/hdp/current/tez-client/*<CPS>/usr/hdp/current/tez-client/lib/*<CPS>/etc/tez/conf/<CPS>/usr/hdp/2.2.0.0-2041/tez/*<CPS>/usr/hdp/2.2.0.0-2041/tez/lib/*<CPS>/etc/tez/conf</value>
</entry>
</environment>
<commands>
<command>hadoop jar /usr/hdp/2.2.0.0-2041/hadoop-mapreduce/hadoop-mapreduce-examples-2.6.0.2.2.0.0-2041.jar pi 10 10</command>
</commands>
</am-container-spec>
<unmanaged-AM>false</unmanaged-AM>
<max-app-attempts>2</max-app-attempts>
<resource>
<memory>1024</memory>
<vCores>1</vCores>
</resource>
<application-type>MAPREDUCE</application-type>
<keep-containers-across-application-attempts>false</keep-containers-across-application-attempts>
<application-tags>
<tag>Michael</tag>
<tag>PI example</tag>
</application-tags>
</application-submission-context>
答案 0 :(得分:0)
很抱歉,如果这已经很晚了,您可能已经找到了答案,但是您想要使用POST http请求而不是PUT。