本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
搭配 FSx 搭配 ONTAP 使用 Amazon 彈性容器服務
您可以從 Amazon EC2 Linux 或 Windows 執行個體上的 Amazon Elastic Container Service (Amazon ECS) 碼頭容器存取您的 NetApp ONTAP 檔案系統的亞馬遜 FSx。
安裝在 Amazon ECS Linux 容器
-
使用適用於 Linux 容器的 EC2 Linux + 網路叢集範本建立 ECS 叢集。如需詳細資訊,請參閱 Amazon 彈性容器服務開發人員指南中的建立叢集。
-
在 EC2 執行個體上建立一個目錄以掛接 SVM 磁碟區,如下所示:
sudo mkdir /fsxontap
-
在執行個體啟動期間使用使用者資料指令碼,或執行下列命令,將 FSx for ONTAP 磁碟區掛載到 Linux EC2 執行個體上:
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 位址 SVM,而不是它的 DNS 名稱。
sudo mount -t nfs -o nfsvers=4.1 198.51.100.1:/vol1 /fsxontap
-
建立 Amazon ECS 任務定義時,請在 JSON 容器定義中新增下列屬性
volumes
和mountPoints
容器屬性。將其取代為適sourcePath
用於 ONTAP 檔案系統的 FSx 中的掛載點和目錄。{ "volumes": [ { "name": "ontap-volume", "host": { "sourcePath": "
mountpoint
" } } ], "mountPoints": [ { "containerPath": "containermountpoint
", "sourceVolume": "ontap-volume" } ], . . . }
安裝在 Amazon ECS 視窗容器
-
使用適用於 Windows 容器的 EC2 視窗 + 網路叢集範本建立 ECS 叢集。如需詳細資訊,請參閱 Amazon 彈性容器服務開發人員指南中的建立叢集。
-
將加入網域的 Windows EC2 執行個體新增至 ECS 視窗叢集,並對應 SMB 共用。
啟動已加入您使用中目錄網域的 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 共用對應至磁碟機。替換您的 FSx 檔案系統和共用名稱的 netbios 或 DNS 名稱以下的值。掛接在 Linux EC2 執行個體上的 NFS 磁碟區第 1 卷會在 FSx 檔案系統上設定為 CIFS 共用連結。
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
用於 ONTAP 檔案系統的 FSx 中的掛載點和目錄。{ "volumes": [ { "name": "ontap-volume", "host": { "sourcePath": "
mountpoint
" } } ], "mountPoints": [ { "containerPath": "containermountpoint
", "sourceVolume": "ontap-volume" } ], . . . }