- Log on to the Alibaba Cloud E-MapReduce console.
- At the top of the navigation bar, click Data Platform.
- In the Actions column, click Design Workflownext to the specified project.
- On the left of the Job Editing page, right-click the folder you want to operate and select New Job.
- In the New Job dialog box, enter the job name and description.
- Select a Hadoop job type to create a Hadoop MapReduce job. This type of job is submitted in the backgroundusing the following process.
hadoop jar xxx.jar [MainClass] -Dxxx ....
- Click OK.
Note You can also create subfolders, rename folders, and delete folders by right-clicking on them.
- Enter the parameters in the Content field that are required to submit this job. Enter the parameters after the Hadoop jar, followed by other command line parameters.
For instance, if you want to submit a Hadoop sleep job that doesnot read or write any data, this will only succeed if you submitMapper/Reducer tasks to the cluster and wait for each task to sleep for a while. In Hadoop, this job is packaged in the Hadoop release version's hadoop-mapreduce-client-jobclient-2.6.0-tests.jar. If this job is submitted from the command line, the command should read as follows.
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 content in the Content field.
/path/to/hadoop-mapreduce-client-jobclient-2.6.0-tests.jar sleep -m 3 -r 3 -mt 100 -rt 100NoteThe jar package path used here is an absolute path on the E-MapReduce host. However, the user may put these jar packages anywhere, and as clusters are created and released, thepackages become unavailable. Therefore, upload the jar package by performing the following steps:
- Users send their own jar packages to the bucket of OSS for storage. When you configure the parameters for Hadoop, click Select OSS path to select and execute the jar package you want from the OSS directory. Thes system will then auto-complete the OSS address for jar packages. Be sure to switch the prefix of the jar to ossref by clicking Switch resource type. This ensures that the jar package is downloaded correctly by MapReduce.
- Click OK. The OSS path for this package will be auto-completed in the Content field. When a job is submitted, the system will find the corresponding jar packages automatically based on this path.
- Behind the jar package path for this OSS, other command line parameters for running jobs will be filled in further.
- Click Save.
In the example above, the sleep job has no data input/output. If you want the job to read data and process input results, such as wordcounts, the data input and output paths need to be specified. You can read/write data on the HDFS of the E-MapReduce cluster as well as on OSS. To read/write data on OSS, write the data path as the OSS path when specifying the input and output paths. For instance:
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