

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

# 使用 FSx for Windows File Server 設定傳輸
<a name="create-fsx-location"></a>

若要在 Amazon FSx for Windows File Server 檔案系統之間傳輸資料，您必須建立 AWS DataSync 傳輸*位置*。DataSync 可以使用此位置做為傳輸資料的來源或目的地。

## 提供 FSx for Windows File Server 檔案系統的 DataSync 存取權
<a name="create-fsx-location-access"></a>

DataSync 會使用伺服器訊息區塊 (SMB) 通訊協定連線至 FSx for Windows File Server 檔案系統，並使用[網路介面](required-network-interfaces.md)從虛擬私有雲端 (VPC) 掛載。

**注意**  
搭配 DataSync VPCs 必須具有預設租用。不支援具有專用租用VPCs。

**Topics**
+ [所需的許可](#create-fsx-windows-location-permissions)
+ [必要的身分驗證通訊協定](#configuring-fsx-windows-authentication-protocols)
+ [DFS 命名空間](#configuring-fsx-windows-location-dfs)

### 所需的許可
<a name="create-fsx-windows-location-permissions"></a>

您必須為 DataSync 使用者提供必要的權限，以掛載和存取 FSx for Windows File Server 檔案、資料夾和檔案中繼資料。

我們建議此使用者屬於 Microsoft Active Directory 群組，以管理您的檔案系統。此群組的詳細資訊取決於您的 Active Directory 設定：
+ 如果您使用 AWS Directory Service for Microsoft Active Directory 搭配 FSx for Windows File Server，則使用者必須是**AWS 委派 FSx 管理員**群組的成員。
+ 如果您使用自我管理 Active Directory 搭配 FSx for Windows File Server，則使用者必須是兩個群組之一的成員：
  + **網域管理員**群組，這是預設委派管理員群組。
  + 具有使用者許可的自訂委派管理員群組，允許 DataSync 複製物件擁有權許可和 Windows 存取控制清單 ACLs)。
**重要**  
在部署檔案系統之後，您無法變更委派管理員群組。您必須重新部署檔案系統，或從備份還原檔案系統，才能使用具有 DataSync 複製中繼資料所需下列使用者權限的自訂委派管理員群組。    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/datasync/latest/userguide/create-fsx-location.html)
+ 如果您想要複製 Windows ACLs，並在 SMB 檔案伺服器與 FSx for Windows File Server 檔案系統之間或在 FSx for Windows File Server 檔案系統之間傳輸，則您提供 DataSync 的使用者必須屬於相同的 Active Directory 網域，或在其網域之間具有 Active Directory 信任關係。

**警告**  
您的 FSx for Windows File Server 檔案系統的 SYSTEM 使用者必須擁有檔案系統中所有資料夾**的完整控制**許可。請勿在您的資料夾上變更此使用者的 NTFS ACL 許可。如果您這麼做，DataSync 可以變更檔案系統的許可，讓您的檔案共用無法存取，並防止檔案系統備份可供使用。如需檔案層級和資料夾層級存取的詳細資訊，請參閱*[ Amazon FSx for Windows File Server 使用者指南](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-file-folder.html)*。

### 必要的身分驗證通訊協定
<a name="configuring-fsx-windows-authentication-protocols"></a>

您的 FSx for Windows File Server 必須使用 DataSync 的 NTLM 身分驗證來存取它。DataSync 無法存取使用 Kerberos 身分驗證的檔案伺服器。

### DFS 命名空間
<a name="configuring-fsx-windows-location-dfs"></a>

DataSync 不支援 Microsoft 分散式檔案系統 (DFS) 命名空間。我們建議您在建立 DataSync 位置時，改為指定基礎檔案伺服器或共用。

如需詳細資訊，請參閱《*Amazon FSx for Windows* [File Server 使用者指南》中的使用 DFS 命名空間分組多個檔案系統](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/group-file-systems.html)。

## 建立 FSx for Windows File Server 傳輸位置
<a name="create-fsx-location-how-to"></a>

開始之前，請確定您的 中已有 FSx for Windows File Server AWS 區域。如需詳細資訊，請參閱[《Amazon FSx for Windows File Server 使用者指南](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/getting-started.html)*》中的 Amazon FSx *入門。

### 使用 DataSync 主控台
<a name="create-fsx-location-access-how-to-console"></a>

1. 在 https：//[https://console.aws.amazon.com/datasync/](https://console.aws.amazon.com/datasync/) 開啟 AWS DataSync 主控台。

1. 在左側導覽窗格中，展開**資料傳輸**，然後選擇**位置**和**建立位置**。

1. 針對**位置類型**，選擇 **Amazon FSx**。

1. 對於 **FSx 檔案系統**，選擇您要用作位置的 FSx for Windows File Server 檔案系統。

1. 針對**共用名稱**，使用斜線輸入 FSx for Windows File Server 的掛載路徑。

   這會指定 DataSync 讀取或寫入資料的路徑 （取決於這是來源或目的地位置）。

   您也可以包含子目錄 （例如 `/path/to/directory`)。

1. 針對**安全群組**，選擇最多五個 Amazon EC2 安全群組，可讓您存取檔案系統偏好的子網路。

   您選擇的安全群組必須能夠與檔案系統的安全群組通訊。如需有關為檔案系統存取設定安全群組的資訊，請參閱 [https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-security-groups.html](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-security-groups.html)。
**注意**  
如果您選擇不允許其本身連線的安全群組，請執行下列其中一項操作：  
設定安全群組以允許其自行通訊。
選擇可與掛載目標安全群組通訊的不同安全群組。

1. 針對**使用者**，輸入可存取 FSx for Windows File Server 的使用者名稱。

   如需詳細資訊，請參閱[所需的許可](#create-fsx-windows-location-permissions)。

1. 針對**密碼**，輸入使用者名稱的密碼。

1. （選用） 對於**網域**，輸入 FSx for Windows File Server 檔案系統所屬的 Windows 網域名稱。

   如果您的環境中有多個 Active Directory 網域，請設定此設定可確保 DataSync 連線至正確的檔案系統。

1. （選用） 輸入**金鑰**和**值**欄位的值，以標記 FSx for Windows File Server。

   標籤可協助您管理、篩選和搜尋 AWS 資源。建議您為位置建立至少一個名稱標籤。

1. 選擇**建立位置**。

### 使用 AWS CLI
<a name="create-location-fsx-cli"></a>

**使用 建立 FSx for Windows File Server 位置 AWS CLI**
+ 使用下列命令來建立 Amazon FSx 位置。

  ```
  aws datasync create-location-fsx-windows \
      --fsx-filesystem-arn arn:aws:fsx:region:account-id:file-system/filesystem-id \
      --security-group-arns arn:aws:ec2:region:account-id:security-group/group-id \
      --user smb-user --password password
  ```

  在 `create-location-fsx-windows`命令中，執行下列動作：
  + `fsx-filesystem-arn` – 指定您要從中傳輸的檔案系統的 Amazon Resource Name (ARN)。
  + `security-group-arns` – 指定最多五個 Amazon EC2 安全群組的 ARNs，這些安全群組可讓您存取檔案系統偏好的子網路。

    您指定的安全群組必須能夠與檔案系統的安全群組通訊。如需為檔案系統存取設定安全群組的相關資訊，請參閱 [https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-security-groups.html](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/limit-access-security-groups.html)。
**注意**  
如果您選擇不允許其本身連線的安全群組，請執行下列其中一項操作：  
設定安全群組以允許其自行通訊。
選擇可與掛載目標安全群組通訊的不同安全群組。
  +  AWS 區域 – 您指定的區域是您的目標 Amazon FSx 檔案系統所在的區域。

上述命令會傳回類似如下的位置 ARN。

```
{ 
    "LocationArn": "arn:aws:datasync:us-west-2:111222333444:location/loc-07db7abfc326c50fb" 
}
```