

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# `[efs]` 區段


定義安裝在前端和運算節點上的 Amazon EFS 組態設定。如需詳細資訊，請參閱《*Amazon EFS API 參考*》中的 [CreateFileSystem](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html)。

若要了解如何在叢集定義中包含 Amazon EFS 檔案系統，請參閱 ``[cluster]` 區段` / ``efs_settings``。

若要將現有的 Amazon EFS 檔案系統用於與叢集生命週期無關的長期永久儲存，請指定 [`efs_fs_id`](#efs-efs-fs-id)。

如果您未指定 [`efs_fs_id`](#efs-efs-fs-id)， 會在建立叢集時從`[efs]`設定 AWS ParallelCluster 中建立 Amazon EFS 檔案系統，並在刪除叢集時刪除檔案系統和資料。

如需詳細資訊，請參閱[最佳實務：將叢集移至新的 AWS ParallelCluster 次要或修補程式版本](best-practices.md#best-practices-cluster-upgrades)。

格式為 `[efs efs-name]`。*efs-name* 必須以字母開頭，包含不超過 30 個字元，且僅包含字母、數字、連字號 (-) 和底線 (\$1)。

```
[efs customfs]
shared_dir = efs
encrypted = false
performance_mode = generalPurpose
```

**Topics**
+ [

## `efs_fs_id`
](#efs-efs-fs-id)
+ [

## `efs_kms_key_id`
](#efs-efs-kms-key-id)
+ [

## `encrypted`
](#efs-encrypted)
+ [

## `performance_mode`
](#efs-performance-mode)
+ [

## `provisioned_throughput`
](#efs-provisioned-throughput)
+ [

## `shared_dir`
](#efs-shared-dir)
+ [

## `throughput_mode`
](#efs-throughput-mode)

## `efs_fs_id`


**（選用）** 定義現有檔案系統的 Amazon EFS 檔案系統 ID。

指定此選項會使 以外的所有其他 Amazon EFS 選項失效[`shared_dir`](cluster-definition.md#cluster-shared-dir)。

如果您設定此選項，它僅支援下列類型的檔案系統：
+ 在堆疊的可用區域中沒有掛載目標的檔案系統。
+ 在堆疊可用區域中具有現有掛載目標的檔案系統，同時允許來自 的傳入和傳出 NFS 流量`0.0.0.0/0`。

驗證 [`efs_fs_id`](#efs-efs-fs-id) 的例行性檢查，需要 IAM 角色才能擁有以下許可：
+ `elasticfilesystem:DescribeMountTargets`
+ `elasticfilesystem:DescribeMountTargetSecurityGroups`
+ `ec2:DescribeSubnets`
+ `ec2:DescribeSecurityGroups`
+ `ec2:DescribeNetworkInterfaceAttribute`

若要避免錯誤，您必須將這些許可新增至 IAM 角色，或設定 `sanity_check = false`。

**重要**  
當您使用 允許的傳入和傳出 NFS 流量設定掛載目標時`0.0.0.0/0`，它會向掛載目標可用區域中任何位置的 NFS 掛載請求公開檔案系統。 AWS 不建議在堆疊的可用區域中建立掛載目標。相反地，讓我們 AWS 處理此步驟。如果您想要在堆疊的可用區域中具有掛載目標，請考慮使用自訂安全群組，方法是在 [`[vpc]`區段](vpc-section.md)下提供[`vpc_security_group_id`](vpc-section.md#vpc-security-group-id)選項。然後，將該安全群組新增至掛載目標，然後關閉 `sanity_check`以建立叢集。

沒有預設值。

```
efs_fs_id = fs-12345
```

[更新政策：如果變更此設定，則不允許更新。](using-pcluster-update.md#update-policy-fail)

## `efs_kms_key_id`


**（選用）** 識別用於保護加密檔案系統的 AWS Key Management Service (AWS KMS) 客戶受管金鑰。如果設定此選項，則必須將 [`encrypted`](#efs-encrypted) 設定設為 `true`。這對應至 *Amazon EFS API 參考*中的 [KmsKeyId](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-KmsKeyId) 參數。

沒有預設值。

```
efs_kms_key_id = 1234abcd-12ab-34cd-56ef-1234567890ab
```

[更新政策：如果變更此設定，則不允許更新。](using-pcluster-update.md#update-policy-fail)

## `encrypted`


**（選用）** 指出檔案系統是否已加密。這對應至 *Amazon EFS API 參考*中的[加密](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-Encrypted)參數。

預設值為 `false`。

```
encrypted = true
```

[更新政策：如果變更此設定，則不允許更新。](using-pcluster-update.md#update-policy-fail)

## `performance_mode`


**（選用）** 定義檔案系統的效能模式。這對應至 *Amazon EFS API 參考*中的 [PerformanceMode](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-PerformanceMode) 參數。

有效選項為下列值：
+ `generalPurpose`
+ `maxIO`

 這兩個值都區分大小寫。

我們建議對大部分檔案系統使用 `generalPurpose` 效能模式。

使用 `maxIO` 效能模式的檔案系統可擴展到更高階的彙總輸出量和每秒操作數。不過，大多數檔案操作的延遲會略高。

建立檔案系統之後，就無法變更此參數。

預設值為 `generalPurpose`。

```
performance_mode = generalPurpose
```

[更新政策：如果變更此設定，則不允許更新。](using-pcluster-update.md#update-policy-fail)

## `provisioned_throughput`


**（選用）** 定義檔案系統的佈建輸送量，以 MiB/s 為單位。這對應至 *Amazon EFS API 參考*中的 [ProvisionedThroughputInMibps](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-response-ProvisionedThroughputInMibps) 參數。

如果使用此參數，則必須將 [`throughput_mode`](#efs-throughput-mode) 設為 `provisioned`。

輸送量配額為 `1024` MiB/s。若要要求增加配額，請聯絡 支援。

最小值為 `0.0` MiB/s。

```
provisioned_throughput = 1024
```

[更新政策：此設定可以在更新期間變更。](using-pcluster-update.md#update-policy-setting-supported)

## `shared_dir`


**（必要）** 定義前端和運算節點上的 Amazon EFS 掛載點。

此為必要參數。只有在指定 時，才會使用 [`shared_dir`](cluster-definition.md#cluster-shared-dir) Amazon EFS 區段。

請勿使用 `NONE`或 `/NONE`做為共用目錄。

下列範例會在 掛載 Amazon EFS`/efs`。

```
shared_dir = efs
```

[更新政策：如果變更此設定，則不允許更新。](using-pcluster-update.md#update-policy-fail)

## `throughput_mode`


**（選用）** 定義檔案系統的輸送量模式。這對應至 *Amazon EFS API 參考*中的 [ThroughputMode](https://docs.aws.amazon.com/efs/latest/ug/API_CreateFileSystem.html#efs-CreateFileSystem-request-ThroughputMode) 參數。

有效選項為下列值：
+ `bursting`
+ `provisioned`

預設值為 `bursting`。

```
throughput_mode = provisioned
```

[更新政策：此設定可以在更新期間變更。](using-pcluster-update.md#update-policy-setting-supported)