

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 작업 템플릿을 생성 및 사용하여 작업 실행 시작
<a name="create-job-template"></a>

이 섹션에서는 작업 템플릿을 생성하고 템플릿을 사용하여 AWS Command Line Interface ()로 작업 실행을 시작하는 방법을 설명합니다AWS CLI.

**작업 템플릿을 생성하는 방법**

1. 다음 예제 JSON 파일에서 볼 수 있듯이 `create-job-template-request.json` 파일을 생성하고 작업 실행에 필요한 파라미터를 지정합니다. 사용 가능한 모든 파라미터에 대한 자세한 내용은 [CreateJobTemplate](https://docs.aws.amazon.com/emr-on-eks/latest/APIReference/Welcome.html) API를 참조하세요.

   `StartJobRun` API에 필요한 대부분의 값은 `jobTemplateData`에서도 필요합니다. 작업 템플릿을 사용하여 StartJobRun을 간접 호출할 때 파라미터에 대해 자리 표시자를 사용하고 값을 제공하려는 경우 작업 템플릿 파라미터에 대한 다음 섹션을 참조하세요.

   ```
   {
      "name": "mytemplate",
      "jobTemplateData": {
           "executionRoleArn": "iam_role_arn_for_job_execution", 
           "releaseLabel": "emr-6.7.0-latest",
           "jobDriver": {
               "sparkSubmitJobDriver": { 
                   "entryPoint": "entryPoint_location",
                   "entryPointArguments": [ "argument1","argument2",...],
                   "sparkSubmitParameters": "--class <main_class> --conf spark.executor.instances=2 --conf spark.executor.memory=2G --conf spark.executor.cores=2 --conf spark.driver.cores=1"
               }
           },
           "configurationOverrides": {
               "applicationConfiguration": [
                   {
                       "classification": "spark-defaults", 
                       "properties": {
                            "spark.driver.memory":"2G"
                       }
                   }
               ], 
               "monitoringConfiguration": {
                   "persistentAppUI": "ENABLED", 
                   "cloudWatchMonitoringConfiguration": {
                       "logGroupName": "my_log_group", 
                       "logStreamNamePrefix": "log_stream_prefix"
                   }, 
                   "s3MonitoringConfiguration": {
                       "logUri": "s3://my_s3_log_location/"
                   }
               }
           }
        }
   }
   ```

1. 로컬에 저장된 `create-job-template-request.json` 파일 경로와 함께 `create-job-template` 명령을 사용합니다.

   ```
   aws emr-containers create-job-template \ 
   --cli-input-json file://./create-job-template-request.json
   ```

**작업 템플릿을 사용하여 작업 실행을 시작하는 방법**

다음 예제와 같이 `StartJobRun` 명령에 가상 클러스터 ID, 작업 템플릿 ID 및 작업 이름을 제공합니다.

```
aws emr-containers start-job-run \
--virtual-cluster-id 123456 \
--name myjob \
--job-template-id 1234abcd
```