How can I run mapreduce job by Hadoop 2.5.1 Rest a

2019-04-15 14:11发布

Hadoop 2.5.1 added a new Rest api to submit an application: http://hadoop.apache.org/docs/r2.5.1/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Applications_APISubmit_Application

"Cluster Applications API(Submit Application) The Submit Applications API can be used to submit applications. In case of submitting applications, you must first obtain an application-id using the Cluster New Application API. "

Until Hadoop 2.4 to run a mapreduce example from command line we must execute the hadoop command line shell: bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.5.1.jar grep input output 'dfs[a-z.]+'

Now in Hadoop 2.5.1 can run the same mapreduce sample using the above Rest api but I was not able (I didn't understand) how the http Request Body should be written. I read the doc above and the example is about a YARN application but I was not able to create a body for a mapreduce application. Specifically is not clear to me how to fill the Elements of the am-container-spec object (specifically local-resources and commands) to let the application to run the hadoop-mapreduce-examples-2.5.1.jar grep example. Can someone send me the JSON or XML about the Request Body to run the above mapreduce example?

0条回答
登录 后发表回答