Configure a Hadoop MapReduce job to submit mapper and reducer tasks to your E-MapReduce cluster.
Prerequisites
Ensure you have created a project. For more information, see project management.Procedure
-
Go to the Projects page in Data Platform.
-
Log in to the E-MapReduce console with your Alibaba Cloud account.
-
In the top navigation bar, select the region and resource group.
-
Click the Data Development tab.
-
-
In the row of the project you want to edit, click Edit Job.
- Create a Hadoop MapReduce job.
- On the left side of the page, right-click the target folder and select Create Job.
- In the Create Job dialog box, enter a Job Name and Description, then select MR from the Job Type drop-down list.
A Hadoop MapReduce job is submitted using the following command:
hadoop jar xxx.jar [MainClass] -D xxx .... - Click OK.
- Edit the job content.
- In the content field, enter the command-line arguments required to submit the job.
Enter the arguments that follow the
hadoop jarcommand: the path to the JAR file, then[MainClass], and other command-line arguments.For example, a Hadoop sleep job submits mapper and reducer tasks that each sleep for a specified time without reading or writing data. In Hadoop 2.6.0, this job is packaged in the hadoop-mapreduce-client-jobclient-2.6.0-tests.jar file. To submit this job from the command line, run:hadoop jar /path/to/hadoop-mapreduce-client-jobclient-2.6.0-tests.jar sleep -m 3 -r 3 -mt 100 -rt 100To configure this job in E-MapReduce, enter the following in the content input box:/path/to/hadoop-mapreduce-client-jobclient-2.6.0-tests.jar sleep -m 3 -r 3 -mt 100 -rt 100Note You can also click + Enter an OSS path, set File Prefix to OSSREF, and then select your file from File Path. The system automatically completes the OSS path for the Hadoop MapReduce script. - Click Save.
The sleep job in the preceding example has no data input or output. If your job needs to read data and write results, such as a WordCount job, you must specify the input and output paths.Data can be read from and written to HDFS on the E-MapReduce cluster or OSS. To use OSS, specify OSS paths for input and output.
jar ossref://emr/checklist/jars/chengtao/hadoop/hadoop-mapreduce-examples-2.6.0.jar randomtextwriter -D mapreduce.randomtextwriter.totalbytes=320000 oss://emr/checklist/data/chengtao/hadoop/Wordcount/Input
- In the content field, enter the command-line arguments required to submit the job.