You can submit programs developed by yourself to MRS to execute them, and obtain the results. This section describes how to submit a MapReduce job on the MRS management console. MapReduce jobs are used to submit JAR programs to quickly process massive amounts of data in parallel and create a distributed data processing and execution environment.
If the job and file management functions are not supported on the cluster details page, submit the jobs in the background.
You have uploaded the program packages and data files required for running jobs to OBS or HDFS.
Before you upload the program packages and data files to OBS, you need to create an OBS agency and bind it to the MRS cluster. For details, see Configuring a Storage-Compute Decoupled Cluster (Agency).
In the Basic Information area on the Dashboard page, click Synchronize on the right side of IAM User Sync to synchronize IAM users. For details, see Synchronizing IAM Users to MRS.
If the IAM username contains spaces (for example, admin 01), a job cannot be created.
Parameter | Description |
|---|---|
Name | Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. NOTE: You are advised to set different names for different jobs. |
Program Path | Path of the program package to be executed. The following requirements must be met:
|
Parameters | (Optional) It is the key parameter for program execution. Multiple parameters are separated by space. Configuration method: Program class name Data input path Data output path
|
Service Parameter | (Optional) It is used to modify service parameters for the job. The parameter modification applies only to the current job. To make the modification take effect permanently for the cluster, follow instructions in Configuring Service Parameters. To add multiple parameters, click Table 2 lists the common service configuration parameters. |
Command Reference | Command submitted to the background for execution when a job is submitted. |
Parameter | Description | Example Value |
|---|---|---|
fs.obs.access.key | Key ID for accessing OBS. | - |
fs.obs.secret.key | Key corresponding to the key ID for accessing OBS. | - |
After the job is created, you can manage it.
The default client installation path for MRS 3.x or later is /opt/Bigdata/client, and for versions earlier than MRS 3.x is /opt/client. Configure the path based on site requirements.
source /opt/Bigdata/client/bigdata_env
kinit MRS cluster user
Example: kinit admin
hadoop fs -Dfs.obs.access.key=AK -Dfs.obs.secret.key=SK -copyToLocal source_path.jar target_path.jar
Example: hadoop fs -Dfs.obs.access.key=XXXX -Dfs.obs.secret.key=XXXX -copyToLocal "obs://mrs-word/program/hadoop-mapreduce-examples-XXX.jar" "/home/omm/hadoop-mapreduce-examples-XXX.jar"
source /opt/Bigdata/client/bigdata_env;hadoop jar execute_jar wordcount input_path output_path
Example: source /opt/Bigdata/client/bigdata_env;hadoop jar /home/omm/hadoop-mapreduce-examples-XXX.jar wordcount -Dfs.obs.access.key=XXXX -Dfs.obs.secret.key=XXXX "obs://mrs-word/input/*" "obs://mrs-word/output/"
In the preceding command, input_path indicates a path for storing job input files on OBS. output_path indicates a path for storing job output files on OBS and needs to be set to a directory that does not exist