기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
EFA 지원 FSx Lustre를 사용하여 클러스터 생성
이 자습서에서는 EFA 지원 FSx Lustre 파일 시스템을 공유 스토리지로 사용하는 클러스터를 생성합니다. EFA가 활성화된 FSx Lustre 파일 시스템을 사용하면 최대 8배의 성능 향상을 제공할 수 있습니다. EFA 지원 파일 시스템이 필요한지 확인하려면 FSx for Lustre 사용 설명서의 EFA 지원 파일 시스템 작업을 참조하세요.
를 사용하는 경우 AWS ParallelCluster 이미지 및 클러스터를 생성하거나 업데이트할 때 생성된 AWS 리소스 AWS ParallelCluster에 대해서만 비용을 지불합니다. 자세한 내용은 AWS 에서 사용하는 서비스 AWS ParallelCluster 단원을 참조하십시오.
요구 사항
-
AWS CLI가 설치 및 구성됩니다.
-
ParallelCluster CLI가 설치 및 구성됩니다.
-
클러스터에 로그인하기 위한 Amazon EC2 키 페어입니다.
-
ParallelCluster CLI를 실행하는 데 필요한 권한이 있는 IAM 역할입니다.
보안 그룹 생성
클러스터와 파일 시스템이 배포될 동일한 VPC에 두 개의 보안 그룹을 생성합니다. 하나는 클러스터 노드에서 실행되는 클라이언트용이고 다른 하나는 파일 시스템용입니다.
# Create security group for the FSx client aws ec2 create-security-group \ --group-name Fsx-Client-SecurityGroup \ --description "Allow traffic for the FSx Lustre client" \ --vpc-idvpc-cluster\ --regionregion# Create security group for the FSx file system aws ec2 create-security-group \ --group-name Fsx-FileSystem-SecurityGroup \ --description "Allow traffic for the FSx Lustre File System" \ --vpc-idvpc-cluster\ --regionregion
나머지 자습서에서는 클라이언트 sg-client 및 파일 시스템의 보안 그룹 ID를 각각 및 sg-file-system로 가정합니다.
EFA에서 요구하는 대로 파일 시스템과의 모든 인바운드/아웃바운드 트래픽을 허용하도록 클라이언트의 보안 그룹을 구성합니다.
# Allow all inbound traffic from the file system to the client aws ec2 authorize-security-group-ingress \ --group-idsg-client\ --protocol -1 \ --port -1 \ --source-groupsg-file-system\ --regionregion# Allow all outbound traffic from the client to the file system aws ec2 authorize-security-group-egress \ --group-idsg-client\ --protocol -1 \ --port -1 \ --source-groupsg-file-system\ --regionregion
EFA에서 요구하는 대로 자체 내의 모든 인바운드/아웃바운드 트래픽과 클라이언트의 모든 인바운드 트래픽을 허용하도록 파일 시스템의 보안 그룹을 구성합니다.
# Allow all inbound traffic within this security group aws ec2 authorize-security-group-ingress \ --group-idsg-file-system\ --protocol -1 \ --port -1 \ --source-groupsg-file-system\ --regionregion# Allow all outbound traffic within this security group aws ec2 authorize-security-group-egress \ --group-idsg-file-system\ --protocol -1 \ --port -1 \ --source-groupsg-file-system\ --regionregion# Allow all inbound traffic from the client aws ec2 authorize-security-group-ingress \ --group-idsg-file-system\ --protocol -1 \ --port -1 \ --source-groupsg-client\ --regionregion# Allow all outbound traffic to the client aws ec2 authorize-security-group-egress \ --group-idsg-file-system\ --protocol -1 \ --port -1 \ --source-groupsg-client\ --regionregion
파일 시스템 생성
컴퓨팅 노드가 위치할 동일한 가용 영역(AZ) 내에 파일 시스템을 생성하고 다음 코드에서를 해당 ID로 바꿉니다. 이는 파일 시스템에서 EFA 작업을 허용하는 데 필요합니다. 파일 시스템 생성의 일부로 EfaEnable 속성을 사용하여 EFA를 활성화합니다.subnet-compute-nodes
aws fsx create-file-system \ --file-system-type LUSTRE \ --storage-capacity 38400 \ --storage-type SSD \ --subnet-idssubnet-compute-nodes\ --security-group-idssg-file-system\ --lustre-configuration DeploymentType=PERSISTENT_2,PerUnitStorageThroughput=125,EfaEnabled=true,MetadataConfiguration={Mode=AUTOMATIC} \ --regionregion
이전 명령에서 반환한 파일 시스템 ID를 기록해 둡니다. 자습서의 나머지 부분에서를이 파일 시스템 ID로 바꿉니다.fs-id
클러스터 생성
-
YAML 구성 파일에 다음 구성이 설정된 클러스터를 AWS ParallelCluster 생성합니다.
-
Ubuntu 22.04와 같이 지원되는 OS를 기반으로 하는 AMI입니다.
-
컴퓨팅 노드는 g6.16xlarge와 같이 Nitro v4+가 있는 EFA 지원 인스턴스 유형을 사용해야 합니다.
-
컴퓨팅 노드는 파일 시스템이 있는 동일한 AZ에 있어야 합니다.
-
컴퓨팅 노드에는 Efa/Enabled가 true로 설정되어 있어야 합니다.
-
컴퓨팅 노드는 FSx for Lustre 사용 설명서의 EFA 클라이언트 구성에 따라 FSx EFA를 사용하도록 FSx Lustre 클라이언트를 구성해야 합니다. 이 가이드에서는를 사용하여 다운로드, 추출 및 실행하는
configure-efa-fsx-lustre-client패키지를 제공합니다setup.sh. 모든 컴퓨팅 노드에 자동으로 적용하려면 아래와 같이 OnNodeStart 사용자 지정 작업에서 다음 단계를 실행합니다. -
파일을 생성하고 컴퓨팅 노드에서 연결할 수
your-bucket있는와 같은 버킷에configure-efa-fsx-lustre-client-wrapper.sh업로드합니다. 위에서 참조한 FSx 설명서의 단계에 따라 래퍼는 다음과 동등한 작업을 수행합니다.#!/bin/bash set -euo pipefail # Download the FSx Lustre EFA client configuration package. # See: https://docs.aws.amazon.com/fsx/latest/LustreGuide/configure-efa-clients.html # Replace the source below with a location reachable from your compute nodes # (for example, your own S3 bucket populated from the FSx documentation package). cd /tmp aws s3 cps3://your-bucket/configure-efa-fsx-lustre-client.zip. unzip -o configure-efa-fsx-lustre-client.zip cd configure-efa-fsx-lustre-client # Configure the FSx Lustre client to use EFA. ./setup.sh
-
-
-
클러스터 구성 파일 생성
config.yaml:Region:regionImage: Os: ubuntu2204 HeadNode: InstanceType: c5.xlarge Networking: SubnetId:subnet-xxxxxxxxxxAdditionalSecurityGroups: -sg-clientSsh: KeyName:my-ssh-keyScheduling: Scheduler: slurm SlurmQueues: - Name: q1 ComputeResources: - Name: cr1 Instances: - InstanceType: g6.16xlarge MinCount: 1 MaxCount: 3 Efa: Enabled: true Networking: SubnetIds: -subnet-xxxxxxxxxx# Subnet in the same AZ where the file system is AdditionalSecurityGroups: -sg-clientPlacementGroup: Enabled: false Iam: S3Access: - BucketName:your-bucketCustomActions: OnNodeStart: # Point this at the wrapper script you created and hosted (see step above). Script:s3://your-bucket/configure-efa-fsx-lustre-client-wrapper.shSharedStorage: - MountDir: /fsx Name: my-fsxlustre-efa-external StorageType: FsxLustre FsxLustreSettings: FileSystemId:fs-id그런 다음 해당 구성을 사용하여 클러스터를 생성합니다.
pcluster create-cluster \ --cluster-name fsx-efa-tutorial \ --cluster-configuration config.yaml \ --regionregion
EFA로 FSx가 작동하는지 확인
Lustre 네트워크 트래픽이 EFA를 사용하고 있는지 확인하려면 지정된 네트워크 인터페이스에 대한 네트워크 트래픽을 표시할 수 있는 Lustre lnetctl 도구를 사용합니다. 이를 위해 컴퓨팅 노드에서 다음 명령을 실행합니다.
# Take note of the number of packets flowing through the interface, # which are specified in statistics:send_count and statistics:recv_count sudo lnetctl net show --net efa -v # Generate traffic to the file system echo 'Hello World' > /fsx/hello-world.txt # Take note of the number of packets flowing through the interface, # which are specified in statistics:send_count and statistics:recv_count sudo lnetctl net show --net efa -v
기능이 작동하는 경우 인터페이스를 통해 흐르는 패킷 수가 증가할 것으로 예상됩니다.