

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

# 클러스터 생성 시 애플리케이션 구성
<a name="emr-configure-apps-create-cluster"></a>

클러스터를 생성할 때 Amazon EMR 콘솔, AWS Command Line Interface (AWS CLI) 또는 AWS SDK를 사용하여 애플리케이션의 기본 구성을 재정의할 수 있습니다.

애플리케이션의 기본 구성을 재정의하려면 구성 분류에 사용자 지정 값을 지정합니다. 구성 분류는 애플리케이션의 구성 XML 파일(예: `hive-site.xml`)에 해당합니다.

구성 분류는 Amazon EMR 릴리스 버전에 따라 다릅니다. 특정 릴리스 버전에서 사용할 수 있는 구성 분류 목록은 릴리스 세부 정보 페이지를 참조하세요. 예를 들어, [Amazon EMR 릴리스 6.4.0](emr-640-release.md#emr-640-class)과 같습니다.

## 클러스터를 생성할 때 콘솔에서 구성 제공
<a name="emr-configure-apps-create-cluster-console"></a>

구성을 제공하려면 **클러스터 생성** 페이지로 이동하여 **소프트웨어 설정**을 확장합니다. 그런 다음 JSON 또는 콘솔에 섀도우 텍스트로 표시되는 간편 구문을 사용하여 구성을 직접 입력할 수 있습니다. 그렇지 않으면 파일의 Amazon S3 URI를 JSON `Configurations` 객체와 함께 제공할 수 있습니다.

인스턴스 그룹에 대한 구성을 제공하려면 클러스터 목록에서 클러스터를 선택한 다음, **구성** 탭을 선택합니다. **인스턴스 그룹 구성** 테이블에서 편집할 인스턴스 그룹을 선택한 다음, **재구성**을 선택합니다.

## 클러스터를 생성할 AWS CLI 때를 사용하여 구성 제공
<a name="emr-configure-apps-create-cluster-cli"></a>

로컬로 또는 Amazon S3에 저장된 JSON 파일의 경로를 제공하여 **create-cluster**에 대한 구성을 제공할 수 있습니다. 다음 예제에서는 Amazon EMR 기본 역할을 사용하며, 이 역할이 생성되어 있다고 가정합니다. 하지만 역할을 직접 생성해야 하는 경우에는 먼저 `aws emr create-default-roles`를 실행하세요.

구성이 로컬 디렉터리에 있는 경우 다음 예제 명령을 사용할 수 있습니다.

```
aws emr create-cluster --use-default-roles --release-label emr-7.12.0 --applications Name=Hive \
--instance-type m5.xlarge --instance-count 3 --configurations file://./configurations.json
```

구성이 Amazon S3 경로에 있는 경우 Amazon S3 경로를 `create-cluster` 명령에 전달하기 전에 다음 해결 방법을 설정해야 합니다.

```
#!/bin/sh
# Assume the ConfigurationS3Path is not public, and its present in the same AWS account as the EMR cluster
ConfigurationS3Path="s3://amzn-s3-demo-bucket/config.json"
# Get a presigned HTTP URL for the s3Path
ConfigurationURL=`aws s3 presign $ConfigurationS3Path --expires-in 300`
# Fetch the presigned URL, and minify the JSON so that it spans only a single line
Configurations=`curl $ConfigurationURL | jq -c .`
aws emr create-cluster --use-default-roles --release-label emr-5.34.0 --instance-type m5.xlarge --instance-count 2 --applications Name=Hadoop Name=Spark --configurations $Configurations
```

## 클러스터를 생성할 때 Java SDK를 사용하여 구성 제공
<a name="emr-configure-apps-create-cluster-sdk"></a>

다음 프로그램 발췌문에서는 AWS SDK for Java를 사용하여 구성을 제공하는 방법을 보여줍니다.

```
Application hive = new Application().withName("Hive");

Map<String,String> hiveProperties = new HashMap<String,String>();
	hiveProperties.put("hive.join.emit.interval","1000");
	hiveProperties.put("hive.merge.mapfiles","true");
	    
Configuration myHiveConfig = new Configuration()
	.withClassification("hive-site")
	.withProperties(hiveProperties);

RunJobFlowRequest request = new RunJobFlowRequest()
	.withName("Create cluster with ReleaseLabel")
	.withReleaseLabel("emr-5.20.0")
	.withApplications(hive)
	.withConfigurations(myHiveConfig)
	.withServiceRole("EMR_DefaultRole")
	.withJobFlowRole("EMR_EC2_DefaultRole")
	.withInstances(new JobFlowInstancesConfig()
		.withEc2KeyName("myEc2Key")
		.withInstanceCount(3)
		.withKeepJobFlowAliveWhenNoSteps(true)
		.withMasterInstanceType("m4.large")
		.withSlaveInstanceType("m4.large")
	);
```