本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
将亚马逊弹性容器服务与 ONTAP FSx 配合使用
你可以从亚马逊 Linux 或 Windows 实例上的亚马逊 FSx 弹性容器服务 (Amazon ECS) Service Docker 容器访问你的 Amazon EC2 for NetApp ONTAP 文件系统。
在 Amazon ECS Linux 容器上挂载
-
使用 Linux 容器的 EC2 Linux + 网络集群模板创建 ECS 集群。有关更多信息,请参阅《Amazon Elastic Container Service 开发人员指南》中的创建集群。
-
在 EC2 实例上创建用于装载 SVM 卷的目录,如下所示:
sudo mkdir /fsxontap
-
通过在实例启动期间使用用户数据脚本或运行以下命令在 Linux EC2 实例上安装您 FSx 的 for ONTAP 卷:
sudo mount -t nfs
svm-ip-address
:/vol1 /fsxontap -
使用以下命令挂载卷。
sudo mount -t nfs -o nfsvers=
NFS_version
svm-dns-name
:/volume-junction-path
/fsxontap以下示例使用示例值。
sudo mount -t nfs -o nfsvers=4.1 svm-01234567890abdef0.fs-01234567890abcdef1.fsx.us-east-1.amazonaws.com:/vol1 /fsxontap
您也可以使用 SVM 的 IP 地址来代替其 DNS 名称。
sudo mount -t nfs -o nfsvers=4.1 198.51.100.1:/vol1 /fsxontap
-
创建 Amazon ECS 任务定义时,请在 JSON 容器定义中添加以下
volumes
和mountPoints
容器属性。将sourcePath
替换为 for ONTAP 文件系统中的 FSx 挂载点和目录。{ "volumes": [ { "name": "ontap-volume", "host": { "sourcePath": "
mountpoint
" } } ], "mountPoints": [ { "containerPath": "containermountpoint
", "sourceVolume": "ontap-volume" } ], . . . }
在 Amazon ECS Windows 容器上挂载
-
使用 Windows 容器的 EC2 Windows + 网络集群模板创建 ECS 集群。有关更多信息,请参阅《Amazon Elastic Container Service 开发人员指南》中的创建集群。
-
将已加入域的 Windows EC2 实例添加到 ECS Windows 群集并映射 SMB 共享。
启动已加入您的 Active Directory 域的 ECS 优化的 Windows EC2 实例,然后运行以下命令初始化 ECS 代理。
PS C:\Users\user>
Initialize-ECSAgent -Cluster windows-fsx-cluster -EnableTaskIAMRole您也可以将脚本中的信息传递到用户数据文本字段,如下所示。
<powershell> Initialize-ECSAgent -Cluster windows-fsx-cluster -EnableTaskIAMRole </powershell>
-
在 EC2 实例上创建 SMB 全局映射,以便您可以将 SMB 共享映射到驱动器。将 netbios 或 DNS 名称下方的值替换为 FSx 文件系统和共享名称。挂载在 Linux EC2 实例上的 NFS 卷 vol1 在文件系统上配置为 CIFS 共享 fsxontap。 FSx
vserver cifs share show -vserver svm08 -share-name fsxontap Vserver: svm08 Share: fsxontap CIFS Server NetBIOS Name:
FSXONTAPDEMO
Path: /vol1 Share Properties: oplocks browsable changenotify show-previous-versions Symlink Properties: symlinks File Mode Creation Mask: - Directory Mode Creation Mask: - Share Comment: - Share ACL: Everyone / Full Control File Attribute Cache Lifetime: - Volume Name: vol1 Offline Files: manual Vscan File-Operations Profile: standard Maximum Tree Connections on Share: 4294967295 UNIX Group for File Create: - -
使用以下命令在 EC2 实例上创建 SMB 全局映射:
New-SmbGlobalMapping -RemotePath \\fsxontapdemo.fsxontap.com\fsxontap -LocalPath
Z
: -
创建 Amazon ECS 任务定义时,请在 JSON 容器定义中添加以下
volumes
和mountPoints
容器属性。将sourcePath
替换为 for ONTAP 文件系统中的 FSx 挂载点和目录。{ "volumes": [ { "name": "ontap-volume", "host": { "sourcePath": "
mountpoint
" } } ], "mountPoints": [ { "containerPath": "containermountpoint
", "sourceVolume": "ontap-volume" } ], . . . }