在 Snowball Edge 上設定和啟動 Amazon S3 相容儲存 - AWS Snowball 邊緣 開發人員指南

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

在 Snowball Edge 上設定和啟動 Amazon S3 相容儲存

將軟體工具從 安裝並設定 AWS 至您的本機環境,以與 Snowball Edge 裝置或裝置叢集和 Snowball Edge 上的 Amazon S3 相容儲存體互動。然後,使用這些工具來設定 Snowball Edge 裝置或叢集,並在 Snowball Edge 上啟動 Amazon S3 相容儲存。

先決條件

Snowball Edge 上的 Amazon S3 相容儲存需要將 Snowball Edge 用戶端和 AWS CLI 安裝到本機環境。您也可以使用 AWS SDK for .NET 和 AWS Tools for Windows PowerShell,在 Snowball Edge 上使用 Amazon S3 相容儲存。 AWS 建議使用下列版本的這些工具:

設定您的本機環境

本節說明如何設定 Snowball Edge 用戶端和您的本機環境,以搭配 Snowball Edge 上的 Amazon S3 相容儲存體使用。

  1. 下載並安裝 Snowball Edge 用戶端。如需詳細資訊,請參閱下載並安裝 Snowball Edge 用戶端

  2. 設定 Snowball Edge 用戶端的設定檔。如需詳細資訊,請參閱設定 Snowball Edge 用戶端的設定檔

  3. 如果您使用的是 AWS SDK for .NET,請設定 clientConfig.AuthenticationRegion 參數值,如下所示:

    clientConfig.AuthenticationRegion = "snow"

設定 Snowball Edge 裝置

在 Snowball Edge 上設定 IAM

AWS Identity and Access Management (IAM) 可協助您精細存取在 Snowball Edge 裝置上執行 AWS 的資源。您可以使用 IAM 來控制能通過身分驗證 (登入) 和授權使用資源的 (具有許可) 的人員。

Snowball Edge 在本機支援 IAM。您可以使用本機 IAM 服務來建立角色,並將 IAM 政策連接到這些角色。您可以使用這些政策來允許執行指派任務所需的存取權。

下列範例允許完整存取 Amazon S3 API:

{ "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": "s3:*", "Resource": "*" } ]

如需更多 IAM 政策範例,請參閱 AWS Snowball 邊緣 開發人員指南

在 Snowball Edge 服務上啟動 Amazon S3 相容儲存

使用下列指示,在 Snowball Edge 裝置或叢集上啟動 Snowball Edge 服務上的 Amazon S3 相容儲存。

如果您偏好更易於使用的體驗,您可以在 Snowball Edge 服務上為使用 的獨立裝置或裝置叢集啟動 Amazon S3 相容儲存 AWS OpsHub。請參閱 使用 在 Snowball Edge 上設定 Amazon S3 相容儲存 AWS OpsHub

  1. 執行下列命令,將您的 Snowball Edge 裝置或裝置叢集解鎖:

    • 對於單一裝置:

      snowballEdge unlock-device --endpoint https://snow-device-ip
    • 對於叢集:

      snowballEdge unlock-cluster
  2. 執行下列命令,並確認 Snowball Edge 裝置或裝置叢集已解除鎖定:

    • 對於單一裝置:

      snowballEdge describe-device --endpoint https://snow-device-ip
    • 對於叢集:

      snowballEdge describe-cluster --device-ip-addresses [snow-device-1-ip] [snow-device-2-ip] / [snow-device-3-ip] [snow-device-4-ip] [snow-device-5-ip] / [snow-device-6-ip]
  3. 對於每個裝置 (無論您有一個或叢集),若要在 Snowball Edge 上啟動 Amazon S3 相容儲存體,請執行下列動作:

    1. PhysicalNetworkInterfaceId 執行下列describe-device命令來擷取裝置的 :

      snowballEdge describe-device --endpoint https://snow-device-ip
    2. 執行下列create-virtual-network-interface命令兩次,為 s3control(適用於儲存貯體操作) 和 (適用於物件操作) 端點建立虛擬網路介面 s3api(VNIs)。

      snowballEdge create-virtual-network-interface --ip-address-assignment dhcp --manifest-file manifest --physical-network-interface-id "PhysicalNetworkInterfaceId" --unlock-code unlockcode --endpoint https://snow-device-ip

      該命令會傳回含有 IP 地址的 JSON 結構。記下該 IP 地址。

      如需這些命令的詳細資訊,請參閱在 Snowball Edge 上設定虛擬網路介面 (VNI)

      注意

      在 Snowball Edge 上啟動與 Amazon S3 相容的儲存會使用裝置資源。

  4. 執行下列start-service命令,在 Snowball Edge 服務上啟動 Amazon S3 相容儲存。 包含您裝置的 IP 地址,以及您為 s3controls3api端點建立的 VNIs 的 Amazon Resource Name (ARNs):

    若要在單一裝置上啟動服務:

    snowballEdge start-service --service-id s3-snow --device-ip-addresses snow-device-1-ip --virtual-network-interface-arns vni-arn-1 vni-arn-2

    若要在叢集上啟動 服務:

    snowballEdge start-service --service-id s3-snow --device-ip-addresses snow-device-1-ip snow-device-2-ip snow-device-3-ip --virtual-network-interface-arns vni-arn-1 vni-arn-2 vni-arn-3 vni-arn-4 vni-arn-5 vni-arn-6

    對於 --virtual-network-interface-arns,包含您在上一個步驟中建立的所有 VNIs 的 ARNs。使用空格分隔每個 ARN。

  5. 針對單一裝置執行下列describe-service命令:

    snowballEdge describe-service --service-id s3-snow

    等待服務狀態為 Active

    針對叢集執行下列describe-service命令:

    snowballEdge describe-service --service-id s3-snow \ --device-ip-addresses snow-device-1-ip snow-device-2-ip snow-device-3-ip

檢視 Snowball Edge 端點上 Amazon S3 相容儲存體的相關資訊

執行 Snowball Edge 服務上的 Amazon S3 相容儲存體時,您可以使用 describe-service Snowball Edge 用戶端命令來檢視與 s3control 和 s3api 端點相關聯的 IP 地址。

snowballEdge describe-service --service-id s3-snow --endpoint https://snow-device-ip-address --profile profile-name
範例 describe-service 命令的輸出

在此範例中,s3control 端點的 IP 地址為 192.168.1.222,s3api 端點的 IP 地址為 192.168.1.152。

{ "ServiceId": "s3-snow", "Autostart": true, "Status": { "State": "ACTIVATING", "Details": "Attaching storage" }, "ServiceCapacities": [ { "Name": "S3 Storage", "Unit": "Byte", "Used": 148599705600, "Available": 19351400294400 } ], "Endpoints": [ { "Protocol": "https", "Port": 443, "Host": "192.168.1.222", "CertificateAssociation": { "CertificateArn": "arn:aws:snowball-device:::certificate/30c563f1124707705117f57f6c3accd42a4528ed6dba1e35c1822a391a717199d8c49973d3c0283494d987463e826f2c" }, "Description": "s3-snow bucket API endpoint (for s3control SDK)", "DeviceId": "JID-beta-207429000001-23-12-28-03-51-11", "Status": { "State": "ACTIVE" } }, { "Protocol": "https", "Port": 443, "Host": "192.168.1.152", "CertificateAssociation": { "CertificateArn": "arn:aws:snowball-device:::certificate/30c563f1124707705117f57f6c3accd42a4528ed6dba1e35c1822a391a717199d8c49973d3c0283494d987463e826f2c" }, "Description": "s3-snow object & bucket API endpoint (for s3api SDK)", "DeviceId": "JID-beta-207429000001-23-12-28-03-51-11", "Status": { "State": "ACTIVATING" } } ] }