

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# `[efs]` 部分
<a name="efs-section"></a>

定义头节点和计算节点上挂载的 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)，则在 AWS ParallelCluster 创建集群时根据`[efs]`设置创建 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`
<a name="efs-efs-fs-id"></a>

**（可选）**为现有文件系统定义 Amazon EFS 文件系统 ID。

指定此选项将使所有其他 Amazon EFS 选项失效，但 [`shared_dir`](cluster-definition.md#cluster-shared-dir) 除外。

如果设置此选项，则它仅支持以下类型的文件系统：
+ 堆栈的可用区中没有挂载目标的文件系统。
+ 堆栈的可用区中有一个允许来自 `0.0.0.0/0` 的入站和出站 NFS 流量的现有挂载目标的文件系统。

用于验证 [`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`
<a name="efs-efs-kms-key-id"></a>

**（可选）**标识用于保护加密文件系统的 AWS Key Management Service (AWS KMS) 客户托管密钥。如果设置了此参数，则必须将 [`encrypted`](#efs-encrypted) 设置为 `true`。这与《*亚马逊 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`
<a name="efs-encrypted"></a>

**（可选）**指示是否对文件系统加密。此参数对应于 *Amazon EFS API 参考* 中的 [Encrypted](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`
<a name="efs-performance-mode"></a>

**（可选）**定义文件系统的性能模式。这与《*亚马逊 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`
<a name="efs-provisioned-throughput"></a>

**（可选）**定义文件系统的预置吞吐量（以 MiB/s 为单位）。这与《*亚马逊 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`
<a name="efs-shared-dir"></a>

**（必需）**定义头节点和计算节点上的 Amazon EFS 挂载点。

此参数为必需参数。仅在指定 [`shared_dir`](cluster-definition.md#cluster-shared-dir) 时使用 Amazon EFS 部分。

请勿使用 `NONE` 或 `/NONE` 作为共享目录。

以下示例在 `/efs` 上挂载 Amazon EFS。

```
shared_dir = efs
```

[更新策略：如果更改此设置，则不允许更新。](using-pcluster-update.md#update-policy-fail)

## `throughput_mode`
<a name="efs-throughput-mode"></a>

**（可选）**定义文件系统的吞吐量模式。这与《*亚马逊 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)