

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

# EFA 클라이언트 구성
<a name="configure-efa-clients"></a>

다음 절차에 따라 Elastic Fabric Adapter(EFA)를 통해 FSx for Lustre 파일 시스템에 액세스하도록 Lustre 클라이언트를 설정합니다.

EFA는 다음 운영 체제를 실행하는 Lustre 클라이언트에서 지원됩니다.
+ Amazon Linux 2023(AL2023)
+ RHEL(Red Hat Enterprise Linux) 9.5 이상
+ 커널 6.8\+이상의 Ubuntu 22.04 이상

EFA는 아래 나열된 Lustre 클라이언트에서 지원됩니다. 자세한 내용은 [Lustre 클라이언트 설치](install-lustre-client.md) 단원을 참조하십시오.

EFA는 EFA를 지원하는 Nitro v4 이상 EC2 인스턴스에서 지원됩니다(trn2 인스턴스 패밀리 제외). *Amazon EC2 사용 설명서*의 [지원되는 인스턴스 유형](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html#efa-instance-types)을 참조하세요.

**Topics**
+ [1단계: 필수 드라이버 설치](#install-required-drivers)
+ [2단계: Lustre 클라이언트에 대해 EFA 구성](#install-efa-on-client)
+ [3단계: EFA 인터페이스](#add-efa-interfaces)

## 1단계: 필수 드라이버 설치
<a name="install-required-drivers"></a>

**참고**  
[딥 러닝 AMI](https://docs.aws.amazon.com/dlami/latest/devguide/what-is-dlami.html)를 사용하는 경우 Lustre 클라이언트, EFA 드라이버 및 NVIDIA GPUDirect 스토리지(GDS) 드라이버가 사전 설치되어 있으므로이 단계를 건너뛸 수 있습니다.

### Lustre 클라이언트 및 EFA 드라이버 설치
<a name="install-lustre-client-efa-driver"></a>

**Lustre 클라이언트 및 EFA 드라이버를 빠르게 설치하려면**

1. 설치 스크립트가 포함된 파일을 다운로드하고 압축을 풉니다.

   ```
   curl -O https://docs.aws.amazon.com/fsx/latest/LustreGuide/samples/install-fsx-lustre-client.zip
   unzip install-fsx-lustre-client.zip
   ```

1. `install-fsx-lustre-client` 폴더로 변경하고 설치 스크립트를 실행합니다.

   ```
   cd install-fsx-lustre-client
   sudo ./bin/install-fsx-lustre-client.sh --install-lustre --install-efa
   ```

   스크립트가 자동으로 다음을 수행합니다.
   + Lustre 클라이언트를 설치합니다.
   + EFA 드라이버를 설치합니다.
   + Lustre 클라이언트 및 EFA 드라이버 설치를 확인합니다.

   `install-fsx-lustre-client.sh` 스크립트에 사용할 수 있는 옵션 및 사용 예제 목록은 zip 파일의 `README.md` 파일을 참조하세요.

### GDS 드라이버 설치(선택 사항)
<a name="install-gds-driver"></a>

이 단계는 FSx for Lustre와 함께 NVIDIA GPUDirect Storage(GDS)를 사용하려는 경우에만 필요합니다.

요구 사항:
+ Amazon EC2 P5, P5e, P5en 또는 P6-B200 인스턴스
+ NVIDIA GDS 드라이버 버전 2.24.2 이상

**클라이언트 인스턴스에 NVIDIA GPUDirect Storage 드라이버 설치**

1. NVIDIA GDS 리포지토리를 복제합니다.

   ```
   git clone https://github.com/NVIDIA/gds-nvidia-fs.git
   ```

1. 드라이버를 빌드하고 설치합니다.

   ```
   cd gds-nvidia-fs/src/
   export NVFS_MAX_PEER_DEVS=128
   export NVFS_MAX_PCI_DEPTH=16
   sudo -E make
   sudo insmod nvidia-fs.ko
   ```

## 2단계: Lustre 클라이언트에 대해 EFA 구성
<a name="install-efa-on-client"></a>

EFA 인터페이스를 사용하여 FSx for Lustre 파일 시스템에 액세스하려면 Lustre EFA 모듈을 설치하고 EFA 인터페이스를 구성해야 합니다.

### 빠른 설정
<a name="quick-setup"></a>

**Lustre 클라이언트를 빠르게 구성하는 방법**

1. Amazon EC2 인스턴스에 연결합니다.

1. 구성 스크립트가 포함된 파일을 다운로드하고 압축을 풉니다.

   ```
   curl -O https://docs.aws.amazon.com/fsx/latest/LustreGuide/samples/configure-efa-fsx-lustre-client.zip
   unzip configure-efa-fsx-lustre-client.zip
   ```

1. `configure-efa-fsx-lustre-client` 폴더로 변경하고 설정 스크립트를 실행합니다.

   ```
   cd configure-efa-fsx-lustre-client
   # for regular IO
   sudo ./setup.sh
   
   # for NVIDIA GPUDirect Storage (GDS) IO
   sudo ./setup.sh --optimized-for-gds
   ```

   스크립트가 자동으로 다음을 수행합니다.
   + Lustre 모듈을 가져옵니다.
   + TCP 및 EFA 인터페이스를 구성합니다.
   + 재부팅 시 자동 구성을 위한 시스템 서비스를 생성합니다.

   `setup.sh` 스크립트에 사용할 수 있는 옵션 및 사용 예제 목록은 zip 파일의 `README.md` 파일을 참조하세요.

### 수동으로 systemd 서비스 관리
<a name="manage-systemd-service"></a>

systemd 서비스 파일은 /etc/systemd/system/configure-efa-fsx-lustre-client.service에 생성됩니다. 다음은 몇 가지 유용한 systemd 관련 명령입니다.

```
# Check status
sudo systemctl status configure-efa-fsx-lustre-client.service

# View logs
sudo journalctl -u configure-efa-fsx-lustre-client.service
# View warnings/errors from dmesg
sudo dmesg
```

자세한 내용은 zip 파일의 `README.md` 파일을 참조하세요.

### 자동 마운트 구성(선택 사항)
<a name="auto-mount-configuration"></a>

Amazon FSx for Lustre 파일 시스템을 자동으로 마운팅하는 방법에 대한 자세한 내용은 [Amazon FSx 파일 시스템 자동 마운트](mount-fs-auto-mount-onreboot.md) 섹션을 참조하세요.

## 3단계: EFA 인터페이스
<a name="add-efa-interfaces"></a>

각 FSx for Lustre 파일 시스템에는 모든 클라이언트 인스턴스에 걸쳐 최대 1,024개의 EFA 연결 제한이 있습니다.

`configure-efa-fsx-lustre-client.sh` 스크립트는 인스턴스 유형에 따라 EFA 인터페이스를 자동으로 구성합니다.


| 인스턴스 유형 | 기본 EFA 인터페이스 수 | 
| --- | --- | 
| p6e-gb200.36xlarge | 8 | 
| p6-b200.48xlarge | 8 | 
| p5en.48xlarge | 8 | 
| p5e.48xlarge | 8 | 
| p5.48xlarge | 8 | 
| 네트워크 카드가 여러 개인 기타 인스턴스 | 2 | 
| 네트워크 카드가 하나인 기타 인스턴스 | 1 | 

클라이언트 인스턴스에 구성된 각 EFA 인터페이스는 FSx for Lustre 파일 시스템에 연결될 때 1,024개의 EFA 연결 한도에 대해 하나의 연결로 계산됩니다.

### 수동으로 EFA 인터페이스 관리
<a name="manage-interfaces-manually"></a>

EFA 인터페이스가 더 많은 인스턴스는 일반적으로 더 높은 처리량을 지원합니다. 총 EFA 연결 한도 이내에서 인터페이스 수를 사용자 지정하여 특정 워크로드의 성능을 최적화할 수 있습니다.

다음 명령을 사용하여 EFA 인터페이스를 수동으로 관리할 수 있습니다.

1. 사용 가능한 EFA 인터페이스 보기:

   ```
   for interface in /sys/class/infiniband/*; do
       if [ ! -e "$interface/device/driver" ]; then continue; fi
       driver=$(basename "$(realpath "$interface/device/driver")")
       if [ "$driver" != "efa" ]; then continue; fi
       echo $(basename $interface)
   done
   ```

1. 현재 구성된 인터페이스 보기:

   ```
   sudo lnetctl net show
   ```

1. EFA 인터페이스 추가:

   ```
   sudo lnetctl net add --net efa --if {{device_name}} --peer-credits 32
   ```

   {{device\_name}}을 1단계의 목록에 있는 실제 디바이스 이름으로 바꿉니다.

1. EFA 인터페이스 제거:

   ```
   sudo lnetctl net del --net efa --if {{device_name}}
   ```

   {{device\_name}}을 2단계의 목록에 있는 실제 디바이스 이름으로 바꿉니다.