您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

部署 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.

先决条件Prerequisites

  1. 要部署 Azure 文件同步的同一区域中的 Azure 文件共享。有关详细信息,请参阅:An Azure file share in the same region that you want to deploy Azure File Sync. For more information, see:
  2. 至少有一个受支持的 Windows Server 或 Windows Server 群集实例与 Azure 文件同步同步。有关支持的 Windows Server 版本和推荐的系统资源的详细信息,请参阅 windows file Server 注意事项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 and recommended system resources, see Windows file server considerations.

准备 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 Server Core 上部署 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 region) 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 文件同步。 (建议使用资源组作为容器以逻辑方式将资源隔离到你的组织,例如对 HR 资源或特定项目的资源进行分组。 ) 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 服务器与 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 更新,使 Azure 文件同步保持最新。Enable Microsoft Update to keep Azure File Sync up to date. Azure 文件同步代理的所有更新(包括功能更新和修补程序)都可从 Microsoft 更新进行。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.

注册服务器的管理员必须是给定的存储同步服务的管理角色 所有者参与者 的成员。The administrator registering the server must be a member of the management roles Owner or Contributor for the given Storage Sync Service. 这可以在存储同步服务的 Azure 门户中的 " 访问控制" (IAM) 进行配置。This can be configured under Access Control (IAM) in the Azure portal for the Storage Sync Service.

此外,还可以区分管理员将服务器注册到允许的服务器,也可以在存储同步服务中配置同步。It is also possible to differentiate administrators able to register servers from those allowed to also configure sync in a Storage Sync Service. 为此,您需要创建一个自定义角色,其中列出了只允许注册服务器的管理员,并为您的自定义角色提供下列权限:For that you would need to create a custom role where you list the administrators that are only allowed to register servers and give your custom role the following permissions:

  • "Storagesync.sys/storageSyncServices/registeredServers/write""Microsoft.StorageSync/storageSyncServices/registeredServers/write"
  • "Storagesync.sys/storageSyncServices/read""Microsoft.StorageSync/storageSyncServices/read"
  • "Storagesync.sys/storageSyncServices/工作流/读取""Microsoft.StorageSync/storageSyncServices/workflows/read"
  • "Storagesync.sys/storageSyncServices/工作流/操作/读取""Microsoft.StorageSync/storageSyncServices/workflows/operations/read"

服务器注册 UI 应在 Azure 文件同步代理安装后自动打开。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 卷上的“System Volume Information”隐藏文件夹。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 文件共享的存储帐户的管理角色 所有者 的成员。The administrator creating the cloud endpoint must be a member of the management role Owner for the storage account that contains the Azure file share the cloud endpoint is pointing to. 这可以在 " 访问控制" (IAM) 在存储帐户的 Azure 门户中进行配置。This can be configured under Access Control (IAM) in the Azure portal for the storage account.

若要创建同步组,请在 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.

备注

不支持在卷上创建服务器终结点后更改路径或驱动器号。Changing the path or drive letter after you established a server endpoint on a volume is not supported. 请确保在已注册的服务器上使用最终路径。Make sure you are using a final path on your registered server.

若要添加服务器终结点,请前往新创建的同步组,然后选择 " 添加服务器终结点 "。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 Server 路径。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.
  • 初始下载模式 :这是可选选择,从代理版本11开始,在 Azure 文件共享中存在文件但服务器上没有文件时,这会很有用。Initial download mode : This is an optional selection, starting with agent version 11, that can be helpful when there are files in the Azure file share but not on the server. 例如,如果您创建一个服务器终结点来向同步组添加另一个分支机构服务器,或者在灾难恢复失败的服务器时,则可能存在这种情况。Such a situation can exist, for instance, if you create a server endpoint to add another branch office server to a sync group or when you disaster-recover a failed server. 如果启用了云分层,则默认情况下将仅重新调用命名空间,最初不会有任何文件内容。If cloud tiering is enabled, the default is to only recall the namespace, no file content initially. 如果你认为用户访问请求应决定将哪些文件内容撤回到服务器,这会很有用。That is useful if you believe that rather user access requests should decide what file content is recalled to the server. 如果已禁用云分层,则默认情况下将先下载命名空间,然后将根据上次修改的时间戳撤回文件,直到达到本地容量。If cloud tiering is disabled, the default is that the namespace will download first and then files will be recalled based on last-modified timestamp until the local capacity has been reached. 但是,可以将初始下载模式改为仅命名空间。You can however change the initial download mode to namespace only. 如果为此服务器终结点禁用了云分层,则只能使用第三种模式。A third mode can only be used if cloud tiering is disabled for this server endpoint. 此模式避免首先撤回命名空间。This mode avoids recalling the namespace first. 如果文件有机会完全下载,则文件将仅出现在本地服务器上。Files will only appear on the local server if they had a chance to fully download. 此模式在以下情况下非常有用:应用程序要求存在完整文件,并且无法容忍其命名空间中的分层文件。This mode is useful if for instance an application requires full files to be present and cannot tolerate tiered files in it's namespace.

若要添加服务器终结点,请选择 " 创建 "。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 文件共享进行预 seed。Pre-seed Azure file shares with the server data using any data transfer tool over the SMB. 例如,Robocopy。Robocopy, for example. 还可以使用 AzCopy 而不是 REST。YOu can also use AzCopy over REST. 请确保将 AzCopy 与适当的开关一起使用,以保留 Acl 时间戳和属性。Be sure to use AzCopy with the appropriate switches to preserve ACLs timestamps and attributes.
  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 -

  • 在同步拓扑完全启动并运行之前更改服务器上的数据可能会导致各个服务器终结点上发生冲突。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的版本将不具有 StorageSyncSelfService 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 调用,此 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,则还必须在群集中的所有其他节点上运行该 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.

每个卷的默认最大 VSS 快照数 (64) 以及用于执行该操作的默认计划,将导致信息工作者可以从其还原的以前版本中的最大值为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.

主动从 Azure 文件共享撤回新文件和更改的文件Proactively recall new and changed files from an Azure file share

对于代理版本11,新模式在服务器终结点上可用。With agent version 11, a new mode becomes available on a server endpoint. 即使在本地用户访问任何文件之前,此模式也允许全球分布的公司预先填充的远程区域中的服务器缓存。This mode allows globally distributed companies to have the server cache in a remote region pre-populated even before local users are accessing any files. 在服务器终结点上启用时,此模式将导致此服务器撤回在 Azure 文件共享中已创建或更改的文件。When enabled on a server endpoint, this mode will cause this server to recall files that have been created or changed in the Azure file share.

方案Scenario

全球分布式公司在美国和印度有分支机构。A globally distributed company has branch offices in the US and in India. 早上 (我们的时间) 信息工作者为全新的项目创建一个新文件夹和新文件,并在其上工作一整天。In the morning (US time) information workers create a new folder and new files for a brand new project and work all day on it. Azure 文件同步会将文件夹和文件同步到 (云终结点) 的 Azure 文件共享。Azure File Sync will sync folder and files to the Azure file share (cloud endpoint). 印度的信息工作者将继续在其时区中处理该项目。Information workers in India will continue working on the project in their timezone. 在上午,印度的本地 Azure 文件同步启用的服务器需要在本地提供这些新文件,使印度团队能够有效地使用本地缓存。When they arrive in the morning, the local Azure File Sync enabled server in India needs to have these new files available locally, such that the India team can efficiently work off of a local cache. 启用此模式可防止初始文件访问速度较慢,因为需要重新调用,并使服务器能够在 Azure 文件共享中更改或创建文件后主动重新调用文件。Enabling this mode prevents the initial file access to be slower because of on-demand recall and enables the server to proactively recall the files as soon as they were changed or created in the Azure file share.

重要

必须认识到,跟踪服务器上的 Azure 文件共享中的更改可能会增加传出流量并从 Azure 计费。It is important to realize that tracking changes in the Azure file share that closely on the server can increase your egress traffic and bill from Azure. 如果在本地不需要回调到服务器的文件,则对服务器的不必要的撤回可能会产生负面影响。If files recalled to the server are not actually needed locally, then unnecessary recall to the server can have negative consequences. 如果你知道在云中最近更改的服务器上预填充缓存,则使用此模式将对使用该服务器上的文件的用户或应用程序产生积极影响。Use this mode when you know pre-populating the cache on a server with recent changes in the cloud will have a positive effect on users or applications using the files on that server.

启用服务器终结点以主动撤回 Azure 文件共享中的更改Enable a server endpoint to proactively recall what changed in an Azure file share

  1. Azure 门户中,请切换到存储同步服务,选择正确的同步组,然后在 Azure 文件共享 (云终结点) 中,确定要密切跟踪其更改的服务器终结点。In the Azure portal, go to your Storage Sync Service, select the correct sync group and then identify the server endpoint for which you want to closely track changes in the Azure file share (cloud endpoint).
  2. 在 "云分层" 部分中,找到 "Azure 文件共享下载" 主题。In the cloud tiering section, find the "Azure file share download" topic. 你将看到当前所选模式,可以将其更改为跟踪 Azure 文件共享更改,并主动地将其重新与服务器撤回。You will see the currently selected mode and can change it to track Azure file share changes more closely and proactively recall them to the server.

显示当前生效的服务器终结点的 Azure 文件共享下载行为的图像,以及用于打开允许更改该服务的菜单的按钮。

将 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