EC2 인스턴스용 배치 그룹(placement group) 생성

EC2 인스턴스용 배치 그룹(placement group) 생성

배치 그룹을 사용해 인스턴스를 서로 상대적으로 배치하는 위치를 제어할 수 있어요. 배치 그룹을 만든 뒤에는 그 배치 그룹에서 인스턴스를 시작할 수 있습니다.

제한 사항 — 리전당 최대 500개의 배치 그룹을 만들 수 있어요.

출처: 문서

본문

콘솔로 배치 그룹 생성

  1. Amazon EC2 콘솔(https://console.aws.amazon.com/ec2/)을 엽니다.
  2. 탐색 창에서 Placement Groups를 선택합니다.
  3. Create placement group을 선택합니다.
  4. Name에 그룹 이름을 지정합니다.
  5. Placement strategy에서 그룹의 배치 전략을 선택합니다: Cluster, Spread, Partition, 또는 Precision time.
    • Spread를 선택했다면 Spread level에서 Host 또는 Rack을 선택합니다.
    • Partition을 선택했다면 Number of partitions에 그룹의 파티션 수를 입력합니다.
    • Cluster를 선택했다면, 클러스터 배치 그룹의 인스턴스가 정밀 시간(precision time) 지원 하드웨어에서 시작되도록 선택적으로 상위 정밀 시간 배치 그룹을 지정할 수 있어요.
  6. (선택) Tags 아래에서 태그를 추가하려면 Add new tag를 선택하고 키와 값을 입력합니다.
  7. Create group을 선택합니다.

AWS CLI

create-placement-group 명령을 사용합니다.

클러스터 배치 그룹 생성 — 클러스터 배치 전략을 사용하고 purpose=production 태그를 적용합니다.

aws ec2 create-placement-group \
    --group-name my-cluster \
    --strategy cluster \
    --tag-specifications 'ResourceType=placement-group,Tags={Key=purpose,Value=production}'

정밀 시간 배치 그룹 부모를 가진 클러스터 배치 그룹 생성 — --parent-group-id 파라미터로 상위 정밀 시간 배치 그룹을 지정합니다.

aws ec2 create-placement-group \
    --group-name my-cluster \
    --strategy cluster \
    --parent-group-id pg-0aaa1111111111111

파티션 배치 그룹 생성 — 분할 배치 전략을 사용하고 --partition-count로 5개의 파티션을 지정합니다.

aws ec2 create-placement-group \
    --group-name HDFS-Group-A \
    --strategy partition \
    --partition-count 5

정밀 시간 배치 그룹 생성 — 정밀-시간 배치 전략을 사용합니다.

aws ec2 create-placement-group \
    --group-name my-precision-time-pg \
    --strategy precision-time

PowerShell

New-EC2PlacementGroup cmdlet을 사용합니다.

클러스터 배치 그룹:

New-EC2PlacementGroup `
    -GroupName my-placement-group `
    -Strategy cluster

정밀 시간 부모가 있는 클러스터 배치 그룹:

New-EC2PlacementGroup `
    -GroupName my-placement-group `
    -Strategy cluster `
    -ParentGroupId pg-0aaa1111111111111

파티션 배치 그룹:

New-EC2PlacementGroup `
    -GroupName my-placement-group `
    -Strategy partition `
    -PartitionCount 5

정밀 시간 배치 그룹:

New-EC2PlacementGroup `
    -GroupName my-precision-time-pg `
    -Strategy precision-time

더 알아보기 (Learn more)