部署 Azure 檔案同步Deploy Azure File Sync

使用 Azure 檔案同步,將組織的檔案共用集中在 Azure 檔案服務中,同時保有內部部署檔案伺服器的彈性、效能及相容性。Use Azure File Sync to centralize your organization's file shares in Azure Files, while keeping the flexibility, performance, and compatibility of an on-premises file server. Azure 檔案同步會將 Windows Server 轉換成 Azure 檔案共用的快速快取。Azure File Sync transforms Windows Server into a quick cache of your Azure file share. 您可以使用 Windows Server 上可用的任何通訊協定來從本機存取資料,包括 SMB、NFS 和 FTPS。You can use any protocol that's available on Windows Server to access your data locally, including SMB, NFS, and FTPS. 您可以視需要存取多個散佈於世界各地的快取。You can have as many caches as you need across the world.

強烈建議您先閱讀規劃 Azure 檔案服務部署規劃 Azure 檔案同步部署,再完成本文章中描述的步驟。We strongly recommend that you read Planning for an Azure Files deployment and Planning for an Azure File Sync deployment before you complete the steps described in this article.

PrerequisitesPrerequisites

  • 要部署 Azure 檔同步的同一區域中的 Azure 檔共用。有關詳細資訊,請參閱:An Azure file share in the same region that you want to deploy Azure File Sync. For more information, see:

  • 至少有一個受支援的 Windows 伺服器或 Windows 伺服器叢集實例,以便與 Azure 檔同步同步。有關受支援版本的 Windows 伺服器的詳細資訊,請參閱與 Windows 伺服器的互通性At least one supported instance of Windows Server or Windows Server cluster to sync with Azure File Sync. For more information about supported versions of Windows Server, see Interoperability with Windows Server.

  • Az PowerShell 模組可與 PowerShell 5.1 或 PowerShell 6+ 一起使用。The Az PowerShell module may be used with either PowerShell 5.1 or PowerShell 6+. 您可以在任何受支援的系統上(包括非 Windows 系統)上使用 Az PowerShell 模組進行 Azure 檔同步,但伺服器註冊 Cmdlet 必須始終在正在註冊的 Windows Server 實例上運行(這可以直接或通過 PowerShell 完成)遠端)。You may use the Az PowerShell module for Azure File Sync on any supported system, including non-Windows systems, however the server registration cmdlet must always be run on the Windows Server instance you are registering (this can be done directly or via PowerShell remoting). 在 Windows 伺服器 2012 R2 上,您可以驗證是否至少正在運行 PowerShell 5.1。*通過查看 $PSVersionTable物件的PSVersion屬性的值:On Windows Server 2012 R2, you can verify that you are running at least PowerShell 5.1.* by looking at the value of the PSVersion property of the $PSVersionTable object:

    $PSVersionTable.PSVersion
    

    如果您的 PSVersion 值小於 5.1.* (大部分的 Windows Server 2012 R2 全新安裝都會發生此類情況),您可以下載並安裝 Windows Management Framework (WMF) 5.1 (英文) 來輕鬆地升級。If your PSVersion value is less than 5.1.*, as will be the case with most fresh installations of Windows Server 2012 R2, you can easily upgrade by downloading and installing Windows Management Framework (WMF) 5.1. 要下載和安裝 Windows Server 2012 R2 的相應套裝軟體是Win8.1AndW2K12R2-KB*******-x64.msuThe appropriate package to download and install for Windows Server 2012 R2 is Win8.1AndW2K12R2-KB*******-x64.msu.

    PowerShell 6+ 可與任何受支援的系統一起使用,並且可以通過其GitHub 頁面下載。PowerShell 6+ can be used with any supported system, and can be downloaded via its GitHub page.

    重要

    如果您計畫使用伺服器註冊 UI,而不是直接從 PowerShell 註冊,則必須使用 PowerShell 5.1。If you plan to use the Server Registration UI, rather than registering directly from PowerShell, you must use PowerShell 5.1.

  • 如果您已選擇使用 PowerShell 5.1,請確保至少安裝了 .NET 4.7.2。If you have opted to use PowerShell 5.1, ensure that at least .NET 4.7.2 is installed. 詳細瞭解.NET 框架版本和系統上的依賴項Learn more about .NET Framework versions and dependencies on your system.

    重要

    如果要在 Windows 伺服器核心上安裝 .NET 4.7.2+,則必須使用quietnorestart標誌進行安裝,否則安裝將失敗。If you are installing .NET 4.7.2+ on Windows Server Core, you must install with the quiet and norestart flags or the installation will fail. 例如,如果安裝 .NET 4.8,該命令將如下所示:For example, if installing .NET 4.8, the command would look like the following:

    Start-Process -FilePath "ndp48-x86-x64-allos-enu.exe" -ArgumentList "/q /norestart" -Wait
    
  • Az PowerShell 模組,可通過此處的說明進行安裝:安裝和配置 Azure PowerShellThe Az PowerShell module, which can be installed by following the instructions here: Install and configure Azure PowerShell.

    注意

    安裝 Az PowerShell 模組時,現在會自動安裝 Az.StorageSync 模組。The Az.StorageSync module is now installed automatically when you install the Az PowerShell module.

準備 Windows Server 以搭配 Azure 檔案同步使用Prepare Windows Server to use with Azure File Sync

針對要與 Azure 檔案同步搭配使用的每個伺服器 (包括容錯移轉叢集中的每個伺服器節點),停用 [Internet Explorer 增強式安全性設定]****。For each server that you intend to use with Azure File Sync, including each server node in a Failover Cluster, disable Internet Explorer Enhanced Security Configuration. 此動作只需要在初始伺服器註冊時執行。This is required only for initial server registration. 您可以在註冊伺服器後重新啟用它。You can re-enable it after the server has been registered.

注意

如果要在 Windows 伺服器核心上部署 Azure 檔同步,則可以跳過此步驟。You can skip this step if you're deploying Azure File Sync on Windows Server Core.

  1. 開啟 [伺服器管理員]。Open Server Manager.
  2. 按一下 [本機伺服器]****:Click Local Server:
    位於伺服器管理員 UI 左側的 [本機伺服器]"Local Server" on the left side of the Server Manager UI
  3. 選取 [屬性]**** 子窗格上的 [IE 增強式安全性設定]**** 連結。On the Properties subpane, select the link for IE Enhanced Security Configuration.
    位於伺服器管理員 UI 中的 [IE 增強式安全性設定] 窗格The "IE Enhanced Security Configuration" pane in the Server Manager UI
  4. 在 [Internet Explorer 增強式安全性設定]**** 對話方塊中,針對 [系統管理員]**** 和 [使用者]**** 選取 [關閉]****:In the Internet Explorer Enhanced Security Configuration dialog box, select Off for Administrators and Users:
    已選取 [關閉] 的 [Internet Explorer 增強式安全性設定] 快顯視窗The Internet Explorer Enhanced Security Configuration pop-window with "Off" selected

部署儲存體同步服務Deploy the Storage Sync Service

部署 Azure 檔案同步的第一步,先將儲存體同步服務資源放到所選訂用帳戶的資源群組中。The deployment of Azure File Sync starts with placing a Storage Sync Service resource into a resource group of your selected subscription. 建議您佈建需要的少數資源群組即可。We recommend provisioning as few of these as needed. 您將在伺服器與此資源之間建立信任關係,而一個伺服器只能註冊到一個儲存體同步服務。You will create a trust relationship between your servers and this resource and a server can only be registered to one Storage Sync Service. 因此,建議您根據需要部署多個儲存體同步服務,以分隔伺服器群組。As a result, it is recommended to deploy as many storage sync services as you need to separate groups of servers. 請記住,不同儲存體同步服務中的伺服器不可以彼此同步。Keep in mind that servers from different storage sync services cannot sync with each other.

注意

存儲同步服務從已部署到的訂閱和資源組中繼承存取權限。The Storage Sync Service inherits access permissions from the subscription and resource group it has been deployed into. 我們建議您仔細檢查誰可以存取此服務。We recommend that you carefully check who has access to it. 具有寫入存取權的實體可以開始將新的一組檔案從已註冊伺服器同步到此儲存體同步服務,並讓資料流向實體可存取的 Azure 儲存體。Entities with write access can start syncing new sets of files from servers registered to this storage sync service and cause data to flow to Azure storage that is accessible to them.

要部署存儲同步服務,請轉到Azure 門戶,按一下"創建資源",然後搜索 Azure 檔同步。在搜尋結果中,選擇Azure 檔同步,然後選擇 "創建"以打開 "部署存儲同步"選項卡。To deploy a Storage Sync Service, go to the Azure portal, click Create a resource and then search for Azure File Sync. In the search results, select Azure File Sync, and then select Create to open the Deploy Storage Sync tab.

在開啟的窗格中,輸入下列資訊:On the pane that opens, enter the following information:

  • 名稱:儲存體同步服務的唯一名稱 (每一訂用帳戶)。Name: A unique name (per subscription) for the Storage Sync Service.
  • 訂用帳戶:您要在其中建立儲存體同步服務的訂用帳戶。Subscription: The subscription in which you want to create the Storage Sync Service. 視您組織的設定策略而定,您可能具有一或多個訂用帳戶的存取權限。Depending on your organization's configuration strategy, you might have access to one or more subscriptions. Azure 訂用帳戶是針對每個雲端服務 (例如 Azure 檔案服務) 計費的最基本容器。An Azure subscription is the most basic container for billing for each cloud service (such as Azure Files).
  • 資源群組:資源群組是 Azure 資源的邏輯群組,例如儲存體帳戶或儲存體同步服務。Resource group: A resource group is a logical group of Azure resources, such as a storage account or a Storage Sync Service. 您可以創建新的資源組或使用現有資源組進行 Azure 檔同步。(我們建議將資源組用作容器,以邏輯方式隔離組織的資源,例如對特定專案的人力資源或資源進行分組。You can create a new resource group or use an existing resource group for Azure File Sync. (We recommend using resource groups as containers to isolate resources logically for your organization, such as grouping HR resources or resources for a specific project.)
  • 位置:要在其中部署 Azure 檔同步的區域。此清單中只有支援的區域可用。Location: The region in which you want to deploy Azure File Sync. Only supported regions are available in this list.

完成時,請選取 [建立]**** 來部署儲存體同步服務。When you are finished, select Create to deploy the Storage Sync Service.

安裝 Azure 檔案同步代理程式Install the Azure File Sync agent

Azure 檔案同步代理程式是可下載的套件,可讓 Windows Server 能夠和 Azure 檔案共用進行同步處理。The Azure File Sync agent is a downloadable package that enables Windows Server to be synced with an Azure file share.

您可以從 Microsoft 下載中心 (英文) 下載該代理程式。You can download the agent from the Microsoft Download Center. 下載之後,請按兩下 MSI 套件以啟動 Azure 檔案同步代理程式安裝。When the download is finished, double-click the MSI package to start the Azure File Sync agent installation.

重要

如果您打算將 Azure 檔案同步搭配容錯移轉叢集使用,則必須在叢集中的每個節點上安裝 Azure 檔案同步代理程式。If you intend to use Azure File Sync with a Failover Cluster, the Azure File Sync agent must be installed on every node in the cluster. 必須註冊群集中的每個節點才能使用 Azure 檔同步。Each node in the cluster must be registered to work with Azure File Sync.

建議您採取下列動作︰We recommend that you do the following:

  • 保留預設的安裝路徑 (C:\Program Files\Azure\StorageSyncAgent),以簡化疑難排解和伺服器維護。Leave the default installation path (C:\Program Files\Azure\StorageSyncAgent), to simplify troubleshooting and server maintenance.
  • 啟用 Microsoft Update 以將 Azure 檔案同步保持在最新狀態。Enable Microsoft Update to keep Azure File Sync up to date. Azure 檔案同步代理程式的所有更新 (包括功能更新和 Hotfix) 都會從 Microsoft Update 進行。All updates, to the Azure File Sync agent, including feature updates and hotfixes, occur from Microsoft Update. 我們建議將最新的更新安裝到 Azure 檔同步。有關詳細資訊,請參閱Azure 檔同步更新策略We recommend installing the latest update to Azure File Sync. For more information, see Azure File Sync update policy.

當 Azure 檔案同步代理程式安裝結束時,伺服器註冊 UI 會自動開啟。When the Azure File Sync agent installation is finished, the Server Registration UI automatically opens. 您必須先有儲存體同步服務才能註冊;請參閱下一節以了解如何建立儲存體同步服務。You must have a Storage Sync Service before registering; see the next section on how to create a Storage Sync Service.

向儲存體同步服務註冊 Windows ServerRegister Windows Server with Storage Sync Service

向儲存體同步服務註冊 Windows Server 會在您的伺服器 (或叢集) 與儲存體同步服務之間建立信任關係。Registering your Windows Server with a Storage Sync Service establishes a trust relationship between your server (or cluster) and the Storage Sync Service. 一部伺服器只能向一個儲存體同步服務註冊,但可以與其他關聯至相同儲存體同步服務的伺服器和 Azure 檔案共用同步。A server can only be registered to one Storage Sync Service and can sync with other servers and Azure file shares associated with the same Storage Sync Service.

注意

伺服器註冊會使用您的 Azure 認證來建立儲存體同步服務和 Windows Server 之間的信任關係;但是,之後伺服器會建立並使用自有的身分識別,只要伺服器維持註冊狀態,且目前的共用存取簽章權杖 (儲存體 SAS) 有效,此身分識別就會是有效的。Server registration uses your Azure credentials to create a trust relationship between the Storage Sync Service and your Windows Server, however subsequently the server creates and uses its own identity that is valid as long as the server stays registered and the current Shared Access Signature token (Storage SAS) is valid. 如果伺服器未註冊,新的 SAS 權杖就無法發行至伺服器,並會因此移除伺服器存取您 Azure 檔案共用的能力,進而停止任何同步。A new SAS token cannot be issued to the server once the server is unregistered, thus removing the server's ability to access your Azure file shares, stopping any sync.

安裝 Azure 檔案同步代理程式之後,伺服器註冊 UI 應該會自動開啟。The Server Registration UI should open automatically after installation of the Azure File Sync agent. 如果沒有,您可以從其檔案位置手動開啟它:C:\Program Files\Azure\StorageSyncAgent\ServerRegistration.exe。If it doesn't, you can open it manually from its file location: C:\Program Files\Azure\StorageSyncAgent\ServerRegistration.exe. 伺服器註冊 UI 開啟時,請選取 [登入]**** 以開始。When the Server Registration UI opens, select Sign-in to begin.

登入之後,系統會提示您輸入下列資訊:After you sign in, you are prompted for the following information:

伺服器註冊 UI 的螢幕擷取畫面

  • Azure 訂用帳戶:包含儲存體同步服務的訂用帳戶 (請參閱部署儲存體同步服務)。Azure Subscription: The subscription that contains the Storage Sync Service (see Deploy the Storage Sync Service).
  • 資源群組:包含儲存體同步服務的資源群組。Resource Group: The resource group that contains the Storage Sync Service.
  • 儲存體同步服務:您要註冊的目標儲存體同步服務名稱。Storage Sync Service: The name of the Storage Sync Service with which you want to register.

選取適當的資訊之後,請選取 [註冊]**** 以完成伺服器註冊。After you have selected the appropriate information, select Register to complete the server registration. 在註冊過程中,系統會提示您額外再登入一次。As part of the registration process, you are prompted for an additional sign-in.

建立同步群組和雲端端點Create a sync group and a cloud endpoint

同步群組定義一組檔案的同步拓撲。A sync group defines the sync topology for a set of files. 同步群組內的端點會與彼此保持同步。Endpoints within a sync group are kept in sync with each other. 同步群組必須包含一個雲端端點,代表 Azure 檔案共用和一個或多個伺服器端點。A sync group must contain one cloud endpoint, which represents an Azure file share and one or more server endpoints. 伺服器終結點表示已註冊伺服器上的路徑。A server endpoint represents a path on a registered server. 伺服器可以在多個同步群組中有多個伺服器端點。A server can have server endpoints in multiple sync groups. 您可以根據需要建立多個同步群組,以適當地描述您想要的同步拓撲。You can create as many sync groups as you need to appropriately describe your desired sync topology.

雲端端點是指向 Azure 檔案共用的指標。A cloud endpoint is a pointer to an Azure file share. 所有伺服器端點都會與雲端端點同步,使雲端端點成為中樞。All server endpoints will sync with a cloud endpoint, making the cloud endpoint the hub. Azure 檔案共用的儲存體帳戶必須位於儲存體同步服務的所在區域。The storage account for the Azure file share must be located in the same region as the Storage Sync Service. Azure 檔案共用的全部內容都會同步,但有一個例外狀況:系統會佈建一個特殊資料夾,其相當於 NTFS 磁碟區上隱藏的「系統磁碟區資訊」資料夾。The entirety of the Azure file share will be synced, with one exception: A special folder, comparable to the hidden "System Volume Information" folder on an NTFS volume, will be provisioned. 此目錄稱為 ".SystemShareInformation"。This directory is called ".SystemShareInformation". 它包含重要的同步中繼資料,而這不會同步到其他端點。It contains important sync metadata that will not sync to other endpoints. 請勿使用或刪除此資料夾!Do not use or delete it!

重要

您可以對同步群組中的任何雲端端點或伺服器端點進行變更,您的檔案將會與同步群組中的其他端點同步。You can make changes to any cloud endpoint or server endpoint in the sync group and have your files synced to the other endpoints in the sync group. 如果直接對雲端端點 (Azure 檔案共用) 進行變更,則必須先由 Azure 檔案同步變更偵測作業探索到該變更。If you make a change to the cloud endpoint (Azure file share) directly, changes first need to be discovered by an Azure File Sync change detection job. 針對雲端端點的變更偵測作業,每隔 24 小時才會起始一次。A change detection job is initiated for a cloud endpoint only once every 24 hours. 如需詳細資訊,請參閱 Azure 檔案服務常見問題集For more information, see Azure Files frequently asked questions.

要創建同步組,請在Azure 門戶中轉到存儲同步服務,然後選擇 "同步組"To create a sync group, in the Azure portal, go to your Storage Sync Service, and then select + Sync group:

在 Azure 入口網站中建立新的同步群組

在開啟的窗格中,輸入下列資訊以建立具有雲端端點的同步群組:In the pane that opens, enter the following information to create a sync group with a cloud endpoint:

  • 同步組名稱:要創建的同步組的名稱。Sync group name: The name of the sync group to be created. 此名稱在儲存體同步服務中必須是唯一的,但可以是任何對您而言合理的名稱。This name must be unique within the Storage Sync Service, but can be any name that is logical for you.
  • 訂用帳戶:您在部署儲存體同步服務中部署儲存體同步服務的訂用帳戶。Subscription: The subscription where you deployed the Storage Sync Service in Deploy the Storage Sync Service.
  • 儲存體帳戶:如果您選取 [選取儲存體帳戶]****,則會顯示另一個窗格,您可在其中選取具有您想要同步之 Azure 檔案共用的儲存體帳戶。Storage account: If you select Select storage account, another pane appears in which you can select the storage account that has the Azure file share that you want to sync with.
  • Azure 檔案共用:您要同步處理的 Azure 檔案共用名稱。Azure file share: The name of the Azure file share with which you want to sync.

建立伺服器端點Create a server endpoint

伺服器端點代表已註冊伺服器上的特定位置,例如伺服器磁碟區上的資料夾。A server endpoint represents a specific location on a registered server, such as a folder on a server volume. 伺服器端點必須是已註冊伺服器 (不是裝載共用) 上的路徑,而且若要使用雲端階層,此路徑必須位在非系統磁碟區上。A server endpoint must be a path on a registered server (rather than a mounted share), and to use cloud tiering, the path must be on a non-system volume. 不支援網路連接儲存裝置 (NAS)。Network attached storage (NAS) is not supported.

若要新增伺服器端點,請移至新建立的同步群組,然後選取 [新增伺服器端點]****。To add a server endpoint, go to the newly created sync group and then select Add server endpoint.

在 [同步群組] 窗格中新增新的伺服器端點

在 [新增伺服器端點]**** 窗格中,輸入下列資訊以建立伺服器端點:In the Add server endpoint pane, enter the following information to create a server endpoint:

  • 已註冊的伺服器:您要建立伺服器端點的伺服器或叢集名稱。Registered server: The name of the server or cluster where you want to create the server endpoint.
  • 路徑:要作為同步組的一部分同步的 Windows 伺服器路徑。Path: The Windows Server path to be synced as part of the sync group.
  • 雲端階層處理:啟用或停用雲端階層處理的開關。Cloud Tiering: A switch to enable or disable cloud tiering. 透過雲端階層處理,可將不常使用或存取的檔案分層處理至 Azure 檔案服務。With cloud tiering, infrequently used or accessed files can be tiered to Azure Files.
  • 磁碟區可用空間:在伺服器端點所在磁碟區上要保留的可用空間數量。Volume Free Space: The amount of free space to reserve on the volume on which the server endpoint is located. 例如,如果具有單一伺服器端點之磁碟區上的磁碟區可用空間是設定為 50%,則大約有一半的資料量會分層處理至 Azure 檔案服務。For example, if volume free space is set to 50% on a volume that has a single server endpoint, roughly half the amount of data is tiered to Azure Files. 無論雲端階層處理是否啟用,您的 Azure 檔案共用在同步群組中一律會有完整的資料複本。Regardless of whether cloud tiering is enabled, your Azure file share always has a complete copy of the data in the sync group.

若要新增伺服器端點,請選取 [建立]****。To add the server endpoint, select Create. 您的檔案現在會在 Azure 檔案共用和 Windows Server 之間保持同步。Your files are now kept in sync across your Azure file share and Windows Server.

配置防火牆和虛擬網路設置Configure firewall and virtual network settings

入口網站Portal

如果要將 Azure 檔同步配置為使用防火牆和虛擬網路設置,請執行以下操作:If you'd like to configure your Azure File sync to work with firewall and virtual network settings, do the following:

  1. 從 Azure 門戶導航到要保護的存儲帳戶。From the Azure portal, navigate to the storage account you want to secure.
  2. 選擇左側功能表上的防火牆和虛擬網路按鈕。Select the Firewalls and virtual networks button on the left menu.
  3. 選擇"允許從 進行訪問****"下的選定網路Select Selected networks under Allow access from.
  4. 確保您的伺服器 IP 或虛擬網路列在相應的部分下。Make sure your servers IP or virtual network is listed under the appropriate section.
  5. 確保選中允許受信任的 Microsoft 服務訪問此存儲帳戶Make sure Allow trusted Microsoft services to access this storage account is checked.
  6. 選擇 "保存" 以保存設置。Select Save to save your settings.

配置防火牆和虛擬網路設置以配合 Azure 檔同步

透過 Azure 檔案同步上架Onboarding with Azure File Sync

第一次於 Azure 檔案同步上架時,如果不想要停機,同時還要保留完整檔案忠實性和存取控制清單 (ACL),其建議步驟如下所示:The recommended steps to onboard on Azure File Sync for the first with zero downtime while preserving full file fidelity and access control list (ACL) are as follows:

  1. 部署儲存體同步服務。Deploy a Storage Sync Service.
  2. 建立同步群組。Create a sync group.
  3. 在具有完整資料集的伺服器上安裝 Azure 檔案同步代理程式。Install Azure File Sync agent on the server with the full data set.
  4. 註冊該伺服器,並在共用上建立伺服器端點。Register that server and create a server endpoint on the share.
  5. 讓同步服務將所有資料完整上傳至 Azure 檔案共用 (雲端端點)。Let sync do the full upload to the Azure file share (cloud endpoint).
  6. 完成初始上傳之後,在其餘的各個伺服器上安裝 Azure 檔案同步代理程式。After the initial upload is complete, install Azure File Sync agent on each of the remaining servers.
  7. 在其餘的各個伺服器上建立新的檔案共用。Create new file shares on each of the remaining servers.
  8. 如有需要,請使用雲端階層處理原則,在新的檔案共用上建立伺服器端點。Create server endpoints on new file shares with cloud tiering policy, if desired. (此步驟需有額外的儲存體以進行初始設定。)(This step requires additional storage to be available for the initial setup.)
  9. 讓 Azure 檔同步代理快速還原完整命名空間,而無需實際資料傳輸。Let Azure File Sync agent do a rapid restore of the full namespace without the actual data transfer. 在完整命名空間同步之後,同步引擎將會根據伺服器端點的雲端階層處理原則,填滿本機磁碟空間。After the full namespace sync, sync engine will fill the local disk space based on the cloud tiering policy for the server endpoint.
  10. 確定同步完成,並視需要測試拓撲。Ensure sync completes and test your topology as desired.
  11. 將使用者和應用程式重新導向到這個新共用。Redirect users and applications to this new share.
  12. 您可以選擇性地刪除伺服器上任何重複的共用。You can optionally delete any duplicate shares on the servers.

如果您沒有額外儲存體可供初始上架,而想要連結至現有的共用,您可以在 Azure 檔案共用中預先植入資料。If you don't have extra storage for initial onboarding and would like to attach to the existing shares, you can pre-seed the data in the Azure files shares. 唯有您可接受停機時間,且絕對保證在初始上架程序期間,伺服器共用上的資料不會變更,才建議使用此方法。This approach is suggested, if and only if you can accept downtime and absolutely guarantee no data changes on the server shares during the initial onboarding process.

  1. 確保任何伺服器上的資料在載入過程中無法更改。Ensure that data on any of the servers can't change during the onboarding process.
  2. 使用 SMB 上的任何資料傳輸工具預占 Azure 檔與伺服器資料共用,例如 Robocopy、直接 SMB 複製。Pre-seed Azure file shares with the server data using any data transfer tool over the SMB for example, Robocopy, direct SMB copy. 因為 AzCopy 不會透過 SMB 上傳資料,所以無法用於預先植入。Since AzCopy does not upload data over the SMB so it can't be used for pre-seeding.
  3. 使用指向現有共用的所需伺服器端點,建立 Azure 檔案同步拓撲。Create Azure File Sync topology with the desired server endpoints pointing to the existing shares.
  4. 讓同步服務在所有端點上完成調整程序。Let sync finish reconciliation process on all endpoints.
  5. 完成調整後,您可以開啟共用進行變更。Once reconciliation is complete, you can open shares for changes.

目前,種子預設定方法有一些局限性:Currently, pre-seeding approach has a few limitations -

  • 檔案不會保持完整不失真。Full fidelity on files is not preserved. 例如,檔案會失去 ACL 和時間戳記。For example, files lose ACLs and timestamps.
  • 在同步拓撲完全啟動並執行之前,伺服器上的資料變更會導致伺服器端點發生衝突。Data changes on the server before sync topology is fully up and running can cause conflicts on the server endpoints.
  • 創建雲終結點後,Azure 檔同步運行一個過程,用於在開始初始同步之前檢測雲中的檔。完成此過程所需要的時間因網路速度、可用頻寬以及檔和資料夾數量等各種因素而異。After the cloud endpoint is created, Azure File Sync runs a process to detect the files in the cloud before starting the initial sync. The time taken to complete this process varies depending on the various factors like network speed, available bandwidth, and number of files and folders. 根據預覽版本中的粗略估計,偵測程序會以大約每秒 10 個檔案的速度執行。因此,即使預先植入的執行速度快,但若在雲端預先植入資料,則系統完整執行的整體時間可能會更長。For the rough estimation in the preview release, detection process runs approximately at 10 files/sec. Hence, even if pre-seeding runs fast, the overall time to get a fully running system may be significantly longer when data is pre-seeded in the cloud.

通過早期版本和 VSS 進行自助服務恢復(卷卷卷影影複製服務)Self-service restore through Previous Versions and VSS (Volume Shadow Copy Service)

重要

以下資訊只能與存儲同步代理的版本 9(或以上)一起使用。The following information can only be used with version 9 (or above) of the storage sync agent. 低於 9 的版本將沒有存儲同步自助服務 Cmdlet。Versions lower than 9 will not have the StorageSyncSelfService cmdlets.

早期版本是一種 Windows 功能,允許您利用卷的伺服器端 VSS 快照向 SMB 用戶端顯示檔的可恢復版本。Previous Versions is a Windows feature that allows you to utilize server-side VSS snapshots of a volume to present restorable versions of a file to an SMB client. 這支援一個強大的方案,通常稱為自助服務還原,直接針對資訊工作者,而不是依賴于從 IT 管理員的還原。This enables a powerful scenario, commonly referred to as self-service restore, directly for information workers instead of depending on the restore from an IT admin.

VSS 快照和早期版本獨立于 Azure 檔同步工作。但是,必須將雲分層設置為相容模式。VSS snapshots and Previous Versions work independently of Azure File Sync. However, cloud tiering must be set to a compatible mode. 許多 Azure 檔同步伺服器終結點可以存在於同一卷上。Many Azure File Sync server endpoints can exist on the same volume. 您必須對每個捲進行以下 PowerShell 調用,該卷甚至有一個伺服器終結點,您計畫或正在其中使用雲分層。You have to make the following PowerShell call per volume that has even one server endpoint where you plan to or are using cloud tiering.

Import-Module ‘<SyncAgentInstallPath>\StorageSync.Management.ServerCmdlets.dll’
Enable-StorageSyncSelfServiceRestore [-DriveLetter] <string> [[-Force]] 

VSS 快照是整個卷的快照。VSS snapshots are taken of an entire volume. 預設情況下,給定卷最多可存在 64 個快照,並授予足夠的空間來存儲快照。By default, up to 64 snapshots can exist for a given volume, granted there is enough space to store the snapshots. VSS 會自動處理此問題。VSS handles this automatically. 預設快照計畫每天(星期一到星期五)拍攝兩個快照。The default snapshot schedule takes two snapshots per day, Monday through Friday. 該計畫可通過 Windows 計畫任務進行配置。That schedule is configurable via a Windows Scheduled Task. 上面的 PowerShell Cmdlet 執行兩件事:The above PowerShell cmdlet does two things:

  1. 它將 Azure 檔同步雲階層式指定卷與以前的版本相容,並保證可以從以前的版本還原檔,即使它分層到伺服器上的雲。It configures Azure File Syncs cloud tiering on the specified volume to be compatible with previous versions and guarantees that a file can be restored from a previous version, even if it was tiered to the cloud on the server.
  2. 它啟用預設 VSS 計畫。It enables the default VSS schedule. 然後,您可以決定稍後對其進行修改。You can then decide to modify it later.

注意

有兩個重點值得注意:There are two important things to note:

  • 如果使用 -Force 參數,並且當前啟用了 VSS,則它將覆蓋當前的 VSS 快照計畫並將其替換為預設計畫。If you use the -Force parameter, and VSS is currently enabled, then it will overwrite the current VSS snapshot schedule and replace it with the default schedule. 請確保在運行 Cmdlet 之前保存自訂配置。Ensure you save your custom configuration before running the cmdlet.
  • 如果在叢集節點上使用此 Cmdlet,還必須在群集中的所有其他節點上運行它!If you are using this cmdlet on a cluster node, you must also run it on all the other nodes in the cluster!

為了查看是否啟用了自助服務還原相容性,可以運行以下 Cmdlet。In order to see if self-service restore compatibility is enabled, you can run the following cmdlet.

    Get-StorageSyncSelfServiceRestore [[-Driveletter] <string>]

它將列出伺服器上的所有卷以及每個卷的雲分層相容天數。It will list all volumes on the server as well as the number of cloud tiering compatible days for each. 此數位根據每個卷的最大可能的快照和預設快照計畫自動計算。This number is automatically calculated based on the maximum possible snapshots per volume and the default snapshot schedule. 因此,預設情況下,向資訊工作者顯示的所有早期版本都可用於從中還原。So by default, all previous versions presented to an information worker can be used to restore from. 如果更改預設計畫以拍攝更多快照,則情況也是如此。The same is true if you change the default schedule to take more snapshots. 但是,如果更改計畫的方式將導致卷上的可用快照早于相容天數值,則使用者將無法使用此較舊的快照(以前的版本)從中還原。However, if you change the schedule in a way that will result in an available snapshot on the volume that is older than the compatible days value, then users will not be able to use this older snapshot (previous version) to restore from.

注意

啟用自助服務還原可能會影響 Azure 存儲消耗和帳單。Enabling self-service restore can have an impact on your Azure storage consumption and bill. 此影響僅限於當前在伺服器上階層式檔。This impact is limited to files currently tiered on the server. 啟用此功能可確保雲中有一個可以通過早期版本 (VSS 快照) 條目引用的檔版本。Enabling this feature ensures that there is a file version available in the cloud that can be referenced via a previous versions (VSS snapshot) entry.

如果禁用該功能,Azure 存儲消耗量將緩慢下降,直到相容的天數視窗過去。If you disable the feature, the Azure storage consumption will slowly decline until the compatible days window has passed. 沒有辦法加快速度。There is no way to speed this up.

每個卷(64)的預設最大 VSS 快照數以及獲取快照的預設計畫,會導致資訊工作者最多可以還原 45 天的以前版本,具體取決於可在卷上存儲多少 VSS 快照。The default maximum number of VSS snapshots per volume (64) as well as the default schedule to take them, result in a maximum of 45 days of previous versions an information worker can restore from, depending on how many VSS snapshots you can store on your volume.

如果最大值每個卷的 64 個 VSS 快照不是正確的設置,您可以通過登錄機碼更改該值If max. 64 VSS snapshots per volume is not the correct setting for you, you can change that value via a registry key. 要使新限制生效,您需要重新運行 Cmdlet,以便在以前啟用的每個卷上啟用以前的版本相容性,並且使用 -Force 標誌來考慮每個卷的新最大 VSS 快照數。For the new limit to take effect, you need to re-run the cmdlet to enable previous version compatibility on every volume it was previously enabled, with the -Force flag to take the new maximum number of VSS snapshots per volume into account. 這將導致新計算的相容天數。This will result in a newly calculated number of compatible days. 請注意,此更改將僅對新分層檔生效,並覆蓋您可能所做的 VSS 計畫上的任何自訂項。Please note that this change will only take effect on newly tiered files and overwrite any customizations on the VSS schedule you might have made.

將 DFS 複寫 (DFS-R) 部署移轉至 Azure 檔案同步Migrate a DFS Replication (DFS-R) deployment to Azure File Sync

若要將 DFS-R 部署移轉至 Azure 檔案同步處理:To migrate a DFS-R deployment to Azure File Sync:

  1. 建立同步群組來代表要取代的 DFS-R 拓樸。Create a sync group to represent the DFS-R topology you are replacing.
  2. 在要移轉 DFS R 拓撲中,於有一組完整資料的伺服器上啟動。Start on the server that has the full set of data in your DFS-R topology to migrate. 在該伺服器上安裝 Azure 檔案同步。Install Azure File Sync on that server.
  3. 註冊該伺服器,並為要移轉的第一個伺服器建立伺服器端點。Register that server and create a server endpoint for the first server to be migrated. 請勿啟用雲端階層。Do not enable cloud tiering.
  4. 將所有資料同步至 Azure 檔案共用 (雲端端點)。Let all of the data sync to your Azure file share (cloud endpoint).
  5. 在其餘的各個 DFS-R 伺服器上安裝並註冊 Azure 檔案同步代理程式。Install and register the Azure File Sync agent on each of the remaining DFS-R servers.
  6. 停用 DFS-R。Disable DFS-R.
  7. 在每一個 DFS-R 伺服器上建立伺服器端點。Create a server endpoint on each of the DFS-R servers. 請勿啟用雲端階層。Do not enable cloud tiering.
  8. 確定同步完成,並視需要測試拓撲。Ensure sync completes and test your topology as desired.
  9. 淘汰 DFS-R。Retire DFS-R.
  10. 現在可在所需的任何伺服器端點上啟用雲端階層。Cloud tiering may now be enabled on any server endpoint as desired.

如需詳細資訊,請參閱Azure 檔案同步與分散式檔案系統 (DFS) 互通For more information, see Azure File Sync interop with Distributed File System (DFS).

後續步驟Next steps