群集到群集存储复制Cluster to cluster Storage Replication

适用于:Windows Server 2019、Windows Server 2016、Windows Server(半年频道)Applies to: Windows Server 2019, Windows Server 2016, Windows Server (Semi-Annual Channel)

存储副本可以在群集之间复制卷,包括使用存储空间直通复制群集。Storage Replica can replicate volumes between clusters, including the replication of clusters using Storage Spaces Direct. 管理和配置与服务器到服务器复制类似。The management and configuration is similar to server-to-server replication.

将在群集到群集配置中配置这些计算机和存储,其中一个群集使用另一群集及其存储组来复制其自身的存储组。You will configure these computers and storage in a cluster-to-cluster configuration, where one cluster replicates its own set of storage with another cluster and its set of storage. 这些节点及其存储应位于单独的物理站点(尽管这不是必需的)。These nodes and their storage should be located in separate physical sites, although it is not required.

重要

在此测试中,四台服务器是示例。In this test, the four servers are an example. 你可以在每个群集中使用 Microsoft 支持的任意数量的服务器,该群集目前为8个存储空间直通群集,64用于共享存储群集。You can use any number of servers supported by Microsoft in each cluster, which is currently 8 for a Storage Spaces Direct cluster and 64 for a shared storage cluster.

本指南不涉及配置存储空间直通。This guide does not cover configuring Storage Spaces Direct. 有关配置存储空间直通的信息,请参阅存储空间直通概述For information about configuring Storage Spaces Direct, see Storage Spaces Direct overview.

此演练使用以下环境作为示例:This walkthrough uses the following environment as an example:

  • 名为 SR SRV01SR SRV02 的两个成员服务器稍后会形成一个名为 SR SRVCLUSA 的群集。Two member servers, named SR-SRV01 and SR-SRV02 that are later formed into a cluster named SR-SRVCLUSA.

  • 名为 SR SRV03SR-SRV04 的两个成员服务器稍后会形成一个名为 SR-SRVCLUSB 的群集。Two member servers named SR-SRV03 and SR-SRV04 that are later formed into a cluster named SR-SRVCLUSB.

  • 表示两个不同数据中心的一对逻辑“站点”,一个名为 Redmond,另一个名为 BellevueA pair of logical "sites" that represent two different data centers, with one called Redmond and one called Bellevue.

通过使用 Redmond 站点中的群集复制 Bellevue 站点中的群集显示示例环境的关系图

图 1:群集到群集复制FIGURE 1: Cluster to cluster Replication

先决条件Prerequisites

  • Active Directory 域服务林(无需运行 Windows Server 2016)。Active Directory Domain Services forest (does not need to run Windows Server 2016).
  • 4-128 服务器 (两个分类2-64 服务器) 运行 Windows Server 2019 或 Windows Server 2016,Datacenter Edition。4-128 servers (two clusters of 2-64 servers) running Windows Server 2019 or Windows Server 2016, Datacenter Edition. 如果你运行的是 Windows Server 2019,则可以改为使用标准版,如果你只是复制一个最大为 2 TB 的卷。If you're running Windows Server 2019, you can instead use Standard Edition if you're OK replicating only a single volume up to 2 TB in size.
  • 两组共享存储,使用 SAS JBOD、光纤通道 SAN、共享 VHDX、存储空间直通或 iSCSI 目标。Two sets of storage, using SAS JBODs, fibre channel SAN, Shared VHDX, Storage Spaces Direct, or iSCSI target. 存储需包含 HDD 和 SSD 媒体的组合。The storage should contain a mix of HDD and SSD media. 将每个存储组设置为仅对每个群集可用(群集间没有共享访问)。You will make each storage set available only to each of the clusters, with no shared access between clusters.
  • 每组存储必须允许至少创建两个虚拟磁盘,一个用于复制的数据,而另一个用于日志。Each set of storage must allow creation of at least two virtual disks, one for replicated data and one for logs. 物理存储在所有数据磁盘上的扇区大小必须相同。The physical storage must have the same sector sizes on all the data disks. 物理存储在所有日志磁盘上的扇区大小必须相同。The physical storage must have the same sector sizes on all the log disks.
  • 每个服务器上必须具有至少一个用于同步复制的以太网/TCP 连接,但最好是 RDMA。At least one ethernet/TCP connection on each server for synchronous replication, but preferably RDMA.
  • 合适的防火墙和路由器规则,以允许所有节点之间的 ICMP、SMB(端口 445 以及用于 SMB 直通的 5445)和 WS-MAN(端口 5985)双向通信。Appropriate firewall and router rules to allow ICMP, SMB (port 445, plus 5445 for SMB Direct) and WS-MAN (port 5985) bi-directional traffic between all nodes.
  • 服务器间的网络具有足够的带宽,以包含 IO 写入工作负载和平均值为 5 毫秒的往返行程延迟(对于同步复制)。A network between servers with enough bandwidth to contain your IO write workload and an average of =5ms round trip latency, for synchronous replication. 异步复制没有延迟建议。Asynchronous replication does not have a latency recommendation.
  • 复制的存储不能位于包含 Windows 操作系统文件夹的驱动器上。The replicated storage cannot be located on the drive containing the Windows operating system folder.
  • 存储空间直通复制 & 限制存在重要的注意事项-请查看以下详细信息。There are important considerations & limitations for Storage Spaces Direct replication - please review the detailed information below.

许多这些要求都可通过使用 Test-SRTopology cmdlet 来确定。Many of these requirements can be determined by using the Test-SRTopology cmdlet. 如果将存储副本或存储副本管理工具功能安装在至少一台服务器上,则会获取此工具的访问权限。You get access to this tool if you install Storage Replica or the Storage Replica Management Tools features on at least one server. 无需将存储副本配置为使用此工具,只需安装 cmdlet。There is no need to configure Storage Replica to use this tool, only to install the cmdlet. 以下步骤中包含更多信息。More information is included in the steps below.

步骤 1:预配操作系统、功能、角色、存储和网络Step 1: Provision operating system, features, roles, storage, and network

  1. 使用 Windows Server ** (桌面体验) **的安装类型在所有四个服务器节点上安装 windows server。Install Windows Server on all four server nodes with an installation type of Windows Server (Desktop Experience).

  2. 添加网络信息并将其添加到域,然后对其重启。Add network information and join them to the domain, then restart them.

    重要

    从现在开始,始终以域用户(所有服务器上的内置管理员组的成员)身份登录。From this point on, always logon as a domain user who is a member of the built-in administrator group on all servers. 在图形服务器安装或在 Windows 10 计算机上运行时,请始终提升你的 Windows PowerShell 和 CMD 命令提示符。Always remember to elevate your Windows PowerShell and CMD prompts going forward when running on a graphical server installation or on a Windows 10 computer.

  3. 将第一组 JBOD 存储机箱、iSCSI 目标、FC SAN 或服务器的本地固定磁盘 (DAS) 存储连接到站点 Redmond.中的服务器。Connect first set of JBOD storage enclosure, iSCSI target, FC SAN, or local fixed disk (DAS) storage to the server in site Redmond.

  4. 将第二组存储连接到站点 Bellevue.中的服务器。Connect second set of storage to the server in site Bellevue.

  5. 根据需要,在所有四个节点上均安装最新的供应商存储和机箱固件及驱动程序、最新的供应商 HBA 驱动程序、最新的供应商 BIOS/UEFI 固件、最新的供应商网络驱动程序和最新的母板芯片组驱动程序。As appropriate, install latest vendor storage and enclosure firmware and drivers, latest vendor HBA drivers, latest vendor BIOS/UEFI firmware, latest vendor network drivers, and latest motherboard chipset drivers on all four nodes. 根据需要重启节点。Restart nodes as needed.

    备注

    请查看配置共享存储和网络硬件的硬件供应商文档。Consult your hardware vendor documentation for configuring shared storage and networking hardware.

  6. 确保服务器的 BIOS/UEFI 设置启用高性能,例如禁用 C-State、设置 QPI 速度、启用 NUMA 和设置最高内存频率。Ensure that BIOS/UEFI settings for servers enable high performance, such as disabling C-State, setting QPI speed, enabling NUMA, and setting highest memory frequency. 确保 Windows Server 中的电源管理设置为高性能。Ensure power management in Windows Server is set to high performance. 根据需要重启。Restart as required.

  7. 配置角色,如下所示:Configure roles as follows:

    • 图形方法Graphical method

      1. 运行 ServerManager.exe 并创建服务器组,添加所有服务器节点。Run ServerManager.exe and create a server group, adding all server nodes.

      2. 在每个节点上安装文件服务器存储副本角色和功能,并对其重启。Install the File Server and Storage Replica roles and features on each of the nodes and restart them.

    • Windows PowerShell 方法Windows PowerShell method

      在 SR-SRV04 或远程管理计算机上,在 Windows PowerShell 控制台中运行以下命令以在四个节点上为拉伸群集安装所需功能和角色,并对其重启:On SR-SRV04 or a remote management computer, run the following command in a Windows PowerShell console to install the required features and roles for a stretch cluster on the four nodes and restart them:

      $Servers = 'SR-SRV01','SR-SRV02','SR-SRV03','SR-SRV04'
      
      $Servers | ForEach { Install-WindowsFeature -ComputerName $_ -Name Storage-Replica,Failover-Clustering,FS-FileServer -IncludeManagementTools -restart }
      

      有关这些步骤的详细信息,请参阅安装或卸载角色、角色服务或功能For more information on these steps, see Install or Uninstall Roles, Role Services, or Features

  8. 配置存储,如下所示:Configure storage as follows:

    重要

    • 必须在每个机箱上创建两个卷:一个用于数据,另一个用于日志。You must create two volumes on each enclosure: one for data and one for logs.
    • 必须将日志和数据磁盘初始化为 GPT,而非 MBRLog and data disks must be initialized as GPT, not MBR.
    • 两个数据卷的大小必须相同。The two data volumes must be of identical size.
    • 两个日志卷的大小应相同。The two log volumes should be of identical size.
    • 所有复制的数据磁盘的扇区大小必须相同。All replicated data disks must have the same sector sizes.
    • 所有日志磁盘的扇区大小必须相同。All log disks must have the same sector sizes.
    • 日志卷应使用基于闪存的存储,如 SSD。The log volumes should use flash-based storage, such as SSD. Microsoft 建议日志存储应比数据存储速度快。Microsoft recommends that the log storage be faster than the data storage. 日志卷不得用于其他工作负荷。Log volumes must never be used for other workloads.
    • 数据磁盘可使用 HDD、SSD 或分层组合,并可使用镜像或奇偶校验空间或 RAID 1 或 10,或者使用 RAID 5 或 RAID 50。The data disks can use HDD, SSD, or a tiered combination and can use either mirrored or parity spaces or RAID 1 or 10, or RAID 5 or RAID 50.
    • 日志卷的默认值必须至少为8GB,并且根据日志要求可能更大或更小。The log volume must be at least 8GB by default and may be larger or smaller based on log requirements.
    • 如果使用存储空间直通 (存储空间直通与 NVME 或 SSD 缓存) ,则在存储空间直通群集之间配置存储副本复制时,将会看到大于预期的延迟增长。When using Storage Spaces Direct (Storage Spaces Direct) with an NVME or SSD cache, you see a greater than expected increase in latency when configuring Storage Replica replication between Storage Spaces Direct clusters. 延迟的变化比在性能 + 容量配置中使用 NVME 和 SSD 时看到的要高得多,并且没有 HDD 层和容量层。The change in latency is proportionally much higher than you see when using NVME and SSD in a performance + capacity configuration and no HDD tier nor capacity tier.

    之所以出现此问题,是因为在比较速度较慢的媒体时,SR 日志机制内的体系结构限制与 NVME 的延迟极低。This issue occurs due to architectural limitations within SR's log mechanism combined with the extremely low latency of NVME when compared to slower media. 使用存储空间直通存储空间直通缓存时,所有 SR 日志的 IO 以及应用程序的所有最新读/写 IO 都将出现在缓存中,而从不会出现在性能层或容量层上。When using Storage Spaces Direct Storage Spaces Direct cache, all IO of SR logs, along with all recent read/write IO of applications, will occur in the cache and never on the performance or capacity tiers. 这意味着所有 SR 活动都在同一速度介质上发生-不建议使用此配置 (请参阅 https://aka.ms/srfaq) 的日志建议。This means that all SR activity happens on the same speed media - this configuration is not supported not recommended (see https://aka.ms/srfaq for log recommendations).

    将存储空间直通与 Hdd 一起使用时,不能禁用或避免缓存。When using Storage Spaces Direct with HDDs, you cannot disable or avoid the cache. 一种解决方法是,如果仅使用 SSD 和 NVME,则可以仅配置性能层和容量层。As a workaround, if using just SSD and NVME, you can configure just performance and capacity tiers. 如果使用该配置,并且只通过将 SR 日志放在性能层上,只使用其服务在容量层上的数据卷,则可以避免上述高延迟问题。If using that configuration, and by placing the SR logs on the performance tier only with the data volumes they service being on the capacity tier only, you will avoid the high latency issue described above. 同样,也可以通过混合速度更快、速度更慢的 Ssd,而不是 NVME。The same could be done with a mix of faster and slower SSDs and no NVME.

    此解决方法当然并不理想,一些客户可能无法利用它。This workaround is of course not ideal and some customers may not be able to make use of it. SR 团队正在致力于优化和更新日志机制,以便在将来减少发生的这些类瓶颈。The SR team is working on optimizations and updated log mechanism for the future to reduce these artificial bottlenecks that occur. 此功能没有 ETA,但当可用于点击客户进行测试时,将会更新此 FAQ。There is no ETA for this, but when available to TAP customers for testing, this FAQ will be updated.

  • 对于 JBOD 存储设备:For JBOD enclosures:
  1. 确保每个群集只能看到该站点的存储机箱,且 SAS 连接已正确配置。Ensure that each cluster can see that site's storage enclosures only and that the SAS connections are correctly configured.

  2. 使用 Windows PowerShell 或服务器管理器,按照在独立服务器上部署存储空间中提供的步骤 1 至 3 使用存储空间来配置存储。Provision the storage using Storage Spaces by following Steps 1-3 provided in the Deploy Storage Spaces on a Stand-Alone Server using Windows PowerShell or Server Manager.

  • 对于 iSCSI 目标存储:For iSCSI Target storage:
  1. 确保每个群集都只能看到该站点的存储机箱。Ensure that each cluster can see that site's storage enclosures only. 如果使用 iSCSI,则应使用多个网络适配器。You should use more than one single network adapter if using iSCSI.

  2. 使用供应商文档配置存储。Provision the storage using your vendor documentation. 如果使用基于 Windows 的 iSCSI 目标,请查阅 iSCSI 目标块存储方法If using Windows-based iSCSI Targeting, consult iSCSI Target Block Storage, How To.

  • 对于 FC SAN 存储:For FC SAN storage:
  1. 确保每个群集只能看到该站点的存储机箱,且对主机进行了正确的分区。Ensure that each cluster can see that site's storage enclosures only and that you have properly zoned the hosts.

  2. 使用供应商文档配置存储。Provision the storage using your vendor documentation.

  • 对于存储空间直通:For Storage Spaces Direct:
  1. 通过部署存储空间直通,确保每个群集只能看到该站点的存储机箱。Ensure that each cluster can see that site's storage enclosures only by deploying Storage Spaces Direct. (https://docs.microsoft.com/windows-server/storage/storage-spaces/hyper-converged-solution-using-storage-spaces-direct)(https://docs.microsoft.com/windows-server/storage/storage-spaces/hyper-converged-solution-using-storage-spaces-direct)

  2. 确保 SR 日志卷将始终位于速度最快的闪存存储上,而数据卷位于速度较慢的高容量存储上。Ensure that the SR log volumes will always be on the fastest flash storage and the data volumes on slower high capacity storage.

  3. 启动 Windows PowerShell,并使用 Test-SRTopology cmdlet 确定是否满足所有存储副本要求。Start Windows PowerShell and use the Test-SRTopology cmdlet to determine if you meet all the Storage Replica requirements. 可以在仅要求模式下使用 cmdlet 以用于快速测试,也可以在长时间运行的性能评估模式下使用。You can use the cmdlet in a requirements-only mode for a quick test as well as a long running performance evaluation mode. 例如,应用于对象的For example,

    MD c:\temp
    
    Test-SRTopology -SourceComputerName SR-SRV01 -SourceVolumeName f: -SourceLogVolumeName g: -DestinationComputerName SR-SRV03 -DestinationVolumeName f: -DestinationLogVolumeName g: -DurationInMinutes 30 -ResultPath c:\temp
    

    重要

    在评估期间,当在指定源卷上使用无写入 IO 负载的测试服务器时,请考虑添加工作负载,否则它将不会生成有用的报表。When using a test server with no write IO load on the specified source volume during the evaluation period, consider adding a workload or it will not generate a useful report. 你应该使用与生产类似的工作负载进行测试,以便看到真实的数值和建议的日志大小。You should test with production-like workloads in order to see real numbers and recommended log sizes. 或者,只需在测试期间将一些文件复制到源卷或下载并运行DISKSPD以生成写入 io。Alternatively, simply copy some files into the source volume during the test or download and run DISKSPD to generate write IOs. 例如,D:卷的5分钟的低写入 IO 工作负载示例:Diskspd.exe -c1g -d300 -W5 -C5 -b8k -t2 -o2 -r -w5 -h d:\test.datFor instance, a sample with a low write IO workload for five minutes to the D: volume: Diskspd.exe -c1g -d300 -W5 -C5 -b8k -t2 -o2 -r -w5 -h d:\test.dat

  4. 检查 TestSrTopologyReport.html 报表以确保符合存储副本要求。Examine the TestSrTopologyReport.html report to ensure that you meet the Storage Replica requirements.

    显示复制拓扑报告结果的屏幕

步骤 2:配置两个横向扩展文件服务器故障转移群集Step 2: Configure two Scale-Out File Server Failover Clusters

现在可以创建两个常规故障转移群集。You will now create two normal failover clusters. 配置、验证和测试完成后,将使用存储副本对其复制。After configuration, validation, and testing, you will replicate them using Storage Replica. 你可以直接在群集节点上或从包含 Windows Server 远程服务器管理工具的远程管理计算机执行以下所有步骤。You can perform all of the steps below on the cluster nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools.

图形方法Graphical method

  1. 在每个站点中对节点运行 cluadmin.mscRun cluadmin.msc against a node in each site.

  2. 验证计划群集并分析结果以确保可以继续。Validate the proposed cluster and analyze the results to ensure you can continue. 以下使用的示例是 SR SRVCLUSASR SRVCLUSBThe example used below are SR-SRVCLUSA and SR-SRVCLUSB.

  3. 创建两个群集。Create the two clusters. 确保群集名称为 15 个字符或更少。Ensure that the cluster names are 15 characters or fewer.

  4. 配置文件共享见证或云见证。Configure a File Share Witness or Cloud Witness.

    备注

    WIndows Server 现在包含云 (基于 Azure) 见证的选项。WIndows Server now includes an option for Cloud (Azure)-based Witness. 你可以选择此仲裁选项来替代文件共享见证。You can choose this quorum option instead of the file share witness.

    警告

    有关仲裁配置的详细信息,请参阅配置和管理仲裁中的见证服务器配置部分。For more information about quorum configuration, see the Witness Configuration section in Configure and Manage Quorum. 有关 Set-ClusterQuorum cmdlet 上的详细信息,请参阅 Set-ClusterQuorumFor more information on the Set-ClusterQuorum cmdlet, see Set-ClusterQuorum.

  5. Redmond 站点中的一个磁盘添加到群集 CSV。Add one disk in the Redmond site to the cluster CSV. 若要执行此操作,右键单击“存储”部分的“磁盘”节点中的源磁盘,然后单击“添加到群集共享卷”。To do so, right click a source disk in the Disks node of the Storage section, and then click Add to Cluster Shared Volumes.

  6. 使用配置横向扩展文件服务器中的说明在两个群集上均创建群集横向扩展文件服务器Create the clustered Scale-Out File Servers on both clusters using the instructions in Configure Scale-Out File Server

Windows PowerShell 方法Windows PowerShell method

  1. 测试计划群集并分析结果以确保可以继续:Test the proposed cluster and analyze the results to ensure you can continue:

    Test-Cluster SR-SRV01,SR-SRV02
    Test-Cluster SR-SRV03,SR-SRV04
    
  2. 创建群集(必须为群集指定你的专用静态 IP 地址)。Create the clusters (you must specify your own static IP addresses for the clusters). 确保每个群集名称为 15 个字符或更少:Ensure that each cluster name is 15 characters or fewer:

    New-Cluster -Name SR-SRVCLUSA -Node SR-SRV01,SR-SRV02 -StaticAddress <your IP here>
    New-Cluster -Name SR-SRVCLUSB -Node SR-SRV03,SR-SRV04 -StaticAddress <your IP here>
    
  3. 在指向托管在域控制器或某些其他独立服务器上的共享的每个群集中配置文件共享见证或云 (Azure) 见证。Configure a File Share Witness or Cloud (Azure) witness in each cluster that points to a share hosted on the domain controller or some other independent server. 例如:For example:

    Set-ClusterQuorum -FileShareWitness \\someserver\someshare
    

    备注

    WIndows Server 现在包含云 (基于 Azure) 见证的选项。WIndows Server now includes an option for Cloud (Azure)-based Witness. 你可以选择此仲裁选项来替代文件共享见证。You can choose this quorum option instead of the file share witness.

    警告

    有关仲裁配置的详细信息,请参阅配置和管理仲裁中的见证服务器配置部分。For more information about quorum configuration, see the Witness Configuration section in Configure and Manage Quorum. 有关 Set-ClusterQuorum cmdlet 上的详细信息,请参阅 Set-ClusterQuorumFor more information on the Set-ClusterQuorum cmdlet, see Set-ClusterQuorum.

  4. 使用配置横向扩展文件服务器中的说明在两个群集上均创建群集横向扩展文件服务器Create the clustered Scale-Out File Servers on both clusters using the instructions in Configure Scale-Out File Server

步骤 3:使用 Windows PowerShell 设置群集到群集复制Step 3: Set up Cluster to Cluster Replication using Windows PowerShell

现在使用 Windows PowerShell 设置群集到群集复制。Now you will set up cluster-to-cluster replication using Windows PowerShell. 你可以直接在节点上或从包含 Windows Server 的远程管理计算机执行以下所有步骤远程服务器管理工具You can perform all of the steps below on the nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools

  1. 通过在第一个群集中的任何节点上运行SRAccess cmdlet,或以远程方式向第一个群集授予对其他群集的完全访问权限。Grant the first cluster full access to the other cluster by running the Grant-SRAccess cmdlet on any node in the first cluster, or remotely. Windows Server 远程服务器管理工具Windows Server Remote Server Administration Tools

    Grant-SRAccess -ComputerName SR-SRV01 -Cluster SR-SRVCLUSB
    
  2. 通过在第二个群集中的任何节点上运行SRAccess cmdlet,或以远程方式向第二个群集授予对其他群集的完全访问权限。Grant the second cluster full access to the other cluster by running the Grant-SRAccess cmdlet on any node in the second cluster, or remotely.

    Grant-SRAccess -ComputerName SR-SRV03 -Cluster SR-SRVCLUSA
    
  3. 配置群集到群集复制、指定源和目标磁盘、源和目标日志、源和目标群集名称以及日志大小。Configure the cluster-to-cluster replication, specifying the source and destination disks, the source and destination logs, the source and destination cluster names, and the log size. 可以在服务器上本地执行此命令,也可以使用远程管理计算机执行。You can perform this command locally on the server or using a remote management computer.

    New-SRPartnership -SourceComputerName SR-SRVCLUSA -SourceRGName rg01 -SourceVolumeName c:\ClusterStorage\Volume2 -SourceLogVolumeName f: -DestinationComputerName SR-SRVCLUSB -DestinationRGName rg02 -DestinationVolumeName c:\ClusterStorage\Volume2 -DestinationLogVolumeName f:
    

    警告

    默认日志大小为 8 GB。The default log size is 8GB. 根据test-srtopology cmdlet 的结果,你可能会决定使用 -具有 logsizeinbytes (具有更高或更低的值)。Depending on the results of the Test-SRTopology cmdlet, you may decide to use -LogSizeInBytes with a higher or lower value.

  4. 若要获取复制源和目标状态,请使用 Get-SRGroupGet-SRPartnership,如下所示:To get replication source and destination state, use Get-SRGroup and Get-SRPartnership as follows:

    Get-SRGroup
    Get-SRPartnership
    (Get-SRGroup).replicas
    
  5. 确定复制进度,如下所示:Determine the replication progress as follows:

    1. 在源服务器上,运行以下命令并检查事件 5015、5002、5004、1237、5001 和2200:On the source server, run the following command and examine events 5015, 5002, 5004, 1237, 5001, and 2200:

      Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica -max 20
      
    2. 在目标服务器上,运行以下命令以查看显示合作关系创建的存储副本事件。On the destination server, run the following command to see the Storage Replica events that show creation of the partnership. 此事件会显示复制的字节数和所用的时间。This event states the number of copied bytes and the time taken. 示例:Example:

      Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | Where-Object {$_.ID -eq "1215"} | Format-List
      

      这是一个输出示例:Here's an example of the output:

      TimeCreated  : 4/8/2016 4:12:37 PM
      ProviderName : Microsoft-Windows-StorageReplica
      Id           : 1215
      Message      : Block copy completed for replica.
          ReplicationGroupName: rg02
          ReplicationGroupId:
          {616F1E00-5A68-4447-830F-B0B0EFBD359C}
          ReplicaName: f:\
          ReplicaId: {00000000-0000-0000-0000-000000000000}
          End LSN in bitmap:
          LogGeneration: {00000000-0000-0000-0000-000000000000}
          LogFileId: 0
          CLSFLsn: 0xFFFFFFFF
          Number of Bytes Recovered: 68583161856
          Elapsed Time (seconds): 117
      
    3. 或者,副本的目标服务器组规定要复制的剩余字节数,且可通过 PowerShell 查询。Alternately, the destination server group for the replica states the number of byte remaining to copy at all times, and can be queried through PowerShell. 例如:For example:

      (Get-SRGroup).Replicas | Select-Object numofbytesremaining
      

      作为进度示例(它将不会终止):As a progress sample (that will not terminate):

        while($true) {
        $v = (Get-SRGroup -Name "Replication 2").replicas | Select-Object numofbytesremaining
        [System.Console]::Write("Number of bytes remaining: {0}`n", $v.numofbytesremaining)
        Start-Sleep -s 5
       }
      
  6. 在目标群集中的目标服务器上,运行以下命令并检查事件 5009、1237、5001、5015、5005 和 2200 以了解处理进度。On the destination server in the destination cluster, run the following command and examine events 5009, 1237, 5001, 5015, 5005, and 2200 to understand the processing progress. 在该序列中不应有错误的警告。There should be no warnings of errors in this sequence. 将有许多 1237 事件;这些表示进度。There will be many 1237 events; these indicate progress.

    Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | FL
    

    备注

    在复制时,目标群集磁盘将始终显示为联机(无访问权限)The destination cluster disk will always show as Online (No Access) when replicated.

步骤 4:管理复制Step 4: Manage replication

现在将管理并操作群集到群集复制。Now you will manage and operate your cluster-to-cluster replication. 你可以直接在群集节点上或从包含 Windows Server 远程服务器管理工具的远程管理计算机执行以下所有步骤。You can perform all of the steps below on the cluster nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools.

  1. 使用 Get-ClusterGroup故障转移群集管理器确定复制的当前源和目标及其状态。Use Get-ClusterGroup or Failover Cluster Manager to determine the current source and destination of replication and their status. Windows Server 远程服务器管理工具Windows Server Remote Server Administration Tools

  2. 若要测量复制性能,请在源和目标节点上均使用 Get-Counter cmdlet。To measure replication performance, use the Get-Counter cmdlet on both the source and destination nodes. 计数器名称为:The counter names are:

    • \Storage Replica Partition I/O Statistics(*)\Number of times flush paused\Storage Replica Partition I/O Statistics(*)\Number of times flush paused

    • \Storage Replica Partition I/O Statistics(*)\Number of pending flush I/O\Storage Replica Partition I/O Statistics(*)\Number of pending flush I/O

    • \Storage Replica Partition I/O Statistics(*)\Number of requests for last log write\Storage Replica Partition I/O Statistics(*)\Number of requests for last log write

    • \Storage Replica Partition I/O Statistics(*)\Avg. Flush Queue Length\Storage Replica Partition I/O Statistics(*)\Avg. Flush Queue Length

    • \Storage Replica Partition I/O Statistics(*)\Current Flush Queue Length\Storage Replica Partition I/O Statistics(*)\Current Flush Queue Length

    • \Storage Replica Partition I/O Statistics(*)\Number of Application Write Requests\Storage Replica Partition I/O Statistics(*)\Number of Application Write Requests

    • \Storage Replica Partition I/O Statistics(*)\Avg. Number of requests per log write\Storage Replica Partition I/O Statistics(*)\Avg. Number of requests per log write

    • \Storage Replica Partition I/O Statistics(*)\Avg. App Write Latency\Storage Replica Partition I/O Statistics(*)\Avg. App Write Latency

    • \Storage Replica Partition I/O Statistics(*)\Avg. App Read Latency\Storage Replica Partition I/O Statistics(*)\Avg. App Read Latency

    • \Storage Replica Statistics(*)\Target RPO\Storage Replica Statistics(*)\Target RPO

    • \Storage Replica Statistics(*)\Current RPO\Storage Replica Statistics(*)\Current RPO

    • \Storage Replica Statistics(*)\Avg. Log Queue Length\Storage Replica Statistics(*)\Avg. Log Queue Length

    • \Storage Replica Statistics(*)\Current Log Queue Length\Storage Replica Statistics(*)\Current Log Queue Length

    • \Storage Replica Statistics(*)\Total Bytes Received\Storage Replica Statistics(*)\Total Bytes Received

    • \Storage Replica Statistics(*)\Total Bytes Sent\Storage Replica Statistics(*)\Total Bytes Sent

    • \Storage Replica Statistics(*)\Avg. Network Send Latency\Storage Replica Statistics(*)\Avg. Network Send Latency

    • \Storage Replica Statistics(*)\Replication State\Storage Replica Statistics(*)\Replication State

    • \Storage Replica Statistics(*)\Avg. Message Round Trip Latency\Storage Replica Statistics(*)\Avg. Message Round Trip Latency

    • \Storage Replica Statistics(*)\Last Recovery Elapsed Time\Storage Replica Statistics(*)\Last Recovery Elapsed Time

    • \Storage Replica Statistics(*)\Number of Flushed Recovery Transactions\Storage Replica Statistics(*)\Number of Flushed Recovery Transactions

    • \Storage Replica Statistics(*)\Number of Recovery Transactions\Storage Replica Statistics(*)\Number of Recovery Transactions

    • \Storage Replica Statistics(*)\Number of Flushed Replication Transactions\Storage Replica Statistics(*)\Number of Flushed Replication Transactions

    • \Storage Replica Statistics(*)\Number of Replication Transactions\Storage Replica Statistics(*)\Number of Replication Transactions

    • \Storage Replica Statistics(*)\Max Log Sequence Number\Storage Replica Statistics(*)\Max Log Sequence Number

    • \Storage Replica Statistics(*)\Number of Messages Received\Storage Replica Statistics(*)\Number of Messages Received

    • \Storage Replica Statistics(*)\Number of Messages Sent\Storage Replica Statistics(*)\Number of Messages Sent

    有关 Windows PowerShell 中的性能计数器的详细信息,请参阅 Get-CounterFor more information on performance counters in Windows PowerShell, see Get-Counter.

  3. 要从一个站点移动复制方向,请使用 Set-SRPartnership cmdlet。To move the replication direction from one site, use the Set-SRPartnership cmdlet.

    Set-SRPartnership -NewSourceComputerName SR-SRVCLUSB -SourceRGName rg02 -DestinationComputerName SR-SRVCLUSA -DestinationRGName rg01
    

    备注

    Windows Server 在初始同步正在进行时阻止角色切换,因为如果在允许初始复制完成前尝试进行切换,则会导致数据丢失。Windows Server prevents role switching when initial sync is ongoing, as it can lead to data loss if you attempt to switch before allowing initial replication to complete. 在初始同步完成前不要强制切换方向。Do not force switch directions until initial sync is complete.

    检查事件日志以查看复制方向的更改和恢复恢复模式发生,然后进行协调。Check the event logs to see the direction of replication change and recovery mode occur, and then reconcile. 写入 IO 然后可以写入到新的源服务器所拥有的存储。Write IOs can then write to the storage owned by the new source server. 更改复制方向将阻止在以前的源计算机上写入 IO。Changing the replication direction will block write IOs on the previous source computer.

    备注

    在复制时,目标群集磁盘将始终显示为联机(无访问权限)The destination cluster disk will always show as Online (No Access) when replicated.

  4. 若要更改默认的 8 GB 日志大小,请在源和目标存储副本组上使用get-srgroupTo change the log size from the default 8GB, use Set-SRGroup on both the source and destination Storage Replica groups.

    重要

    默认日志大小为 8 GB。The default log size is 8GB. 根据 Test-SRTopology cmdlet 的结果,可以决定使用具有较高值或较低值的 LogSizeInBytes。Depending on the results of the Test-SRTopology cmdlet, you may decide to use -LogSizeInBytes with a higher or lower value.

  5. 若要删除复制,请在每个群集上使用 Get-SRGroupGet-SRPartnershipRemove-SRGroupRemove-SRPartnershipTo remove replication, use Get-SRGroup, Get-SRPartnership, Remove-SRGroup, and Remove-SRPartnership on each cluster.

    Get-SRPartnership | Remove-SRPartnership
    Get-SRGroup | Remove-SRGroup
    

    备注

    存储副本用于卸除目标卷。Storage Replica dismounts the destination volumes. 这是设计的结果。This is by design.

其他参考Additional References