创建延伸群集卷并设置复制Create stretched cluster volumes and set up replication

适用于:Azure Stack HCI 版本 20H2Applies to: Azure Stack HCI, version 20H2

本文介绍了如何使用 Windows Admin Center 和 PowerShell 在 Azure Stack HCI 中创建卷并为延伸群集设置复制。This article describes how to create volumes and set up replication for stretched clusters in Azure Stack HCI using Windows Admin Center and PowerShell.

我们将在两个站点的四台服务器上创建卷(以每个站点两台服务器为例)。We will create volumes on four servers in two sites, two servers per site as an example. 但请记住,如果要创建三向镜像卷,则至少需要六台服务器,每个站点三台服务器。Keep in mind however, that if you want to create three-way mirror volumes, you need at least six servers, three servers per site.

使用 Windows Admin Center 创建延伸卷并设置复制Stretched volumes and replication using Windows Admin Center

若要创建卷并设置复制,请执行以下操作:To create a volume and set up replication:

  1. 在 Windows Admin Center 中的“工具”下,选择“卷”。In Windows Admin Center, under Tools, select Volumes.
  2. 在右侧窗格中,选择“清单”选项卡,然后选择“创建”。In the right pane, select the Inventory tab, then select Create.
  3. 在“创建卷”面板中,选择“在站点之间复制卷”。In the Create volume panel, select Replicate volume between sites.
  4. 从下拉框中选择站点之间的复制方向。Select a replication direction between sites from the drop-down box.
  5. 在“复制模式”下,选择“异步”或“同步”。Under Replication mode, select Asynchronous or Synchronous.
  6. 输入源复制组名称和目标复制组名称。Enter a Source replication group name and a Destination replication group name.
  7. 输入所需的日志卷大小。Enter the desired size for the log volume.
  8. 在“高级”下,可以选择执行以下操作:Under Advanced, optionally do the following:
    • 输入/更改“源复制组名称”。Enter/change the Source replication group name.
    • 输入/更改“目标复制组名称”。Enter/change the Destination replication group name.
    • 若要“使用目标上已设定的块”,请选中该复选框。To use blocks already seeded on the target..., select that checkbox.
    • 若要“加密复制流量”,请选中该复选框。To encrypt replication traffic, select that checkbox.
    • 若要“启用一致性组”,请选中该复选框。To enable consistency groups, select that checkbox.
  9. 完成后,单击“创建”。When finished, click Create.
  10. 在右侧窗格中,验证是否在主要(主动)站点中创建了数据磁盘和日志磁盘,以及是否在辅助(被动)站点中创建了相应的数据和日志副本磁盘。In the right pane, verify that a data disk and a log disk are created in your primary (active) site, and that corresponding data and log replica disks are created in the secondary (passive) site. 对于双向复制,应当会看到两组数据和卷磁盘。For bidirectional replication, you should see two sets of data and volume disks.
  11. 在“工具”下,选择“存储副本”。Under Tools, select Storage Replica.
  12. 在右侧窗格中的“合作关系”下,验证复制合作关系是否已成功创建。In the right pane, under Partnerships, verify that the replication partnership has been successfully created.

然后,应在部署 VM 和其他工作负载之前验证站点之间的数据复制是否已成功。Afterwards, you should verify successful data replication between sites before deploying VMs and other workloads. 有关详细信息,请参阅验证群集中的“验证复制”部分。See the Verifying replication section in Validate the cluster for more information.

使用 PowerShell 创建延伸卷Create stretched volumes using PowerShell

单站点标准群集与延伸(双站点)群集的卷创建方式不同。Volume creation is different for single-site standard clusters versus stretched (two-site) clusters. 但是,对于这两种方案,你都使用 New-Volume cmdlet 来创建虚拟磁盘,对其进行分区和格式化,创建具有匹配名称的卷,并将其添加到群集共享卷 (CSV)。For both scenarios however, you use the New-Volume cmdlet to create a virtual disk, partition and format it, create a volume with matching name, and add it to cluster shared volumes (CSV).

为延伸群集创建卷和虚拟磁盘比为单站点群集创建卷和虚拟磁盘复杂一些。Creating volumes and virtual disks for stretched clusters is a bit more involved than for single-site clusters. 延伸群集需要最少四个卷 - 两个数据卷和两个日志卷,每个站点中都有一个数据/日志卷对。Stretched clusters require a minimum of four volumes - two data volumes and two log volumes, with a data/log volume pair residing in each site. 然后,你将为每个站点创建一个复制组,并在它们之间设置复制。Then you will create a replication group for each site, and set up replication between them. 我们需要在服务器之间移动资源组。We need to move resource groups around from server to server. Move-ClusterGroup cmdlet 用于执行此操作。The Move-ClusterGroup cmdlet is used to this.

  1. 首先,我们使用 Move-ClusterGroup cmdlet 将 Available Storage 存储池资源组移到 Site1 中的 Server1First we move the Available Storage storage pool resource group to Server1 in Site1 using the Move-ClusterGroup cmdlet:

    Move-ClusterGroup -Cluster ClusterS1 -Name 'Available Storage' -Node Server1
    
  2. 接下来,为 Site1 中的 Server1 创建第一个虚拟磁盘 (Disk1):Next, create the first virtual disk (Disk1) for Server1 in Site1:

    New-Volume -CimSession Server1 -FriendlyName Disk1 -FileSystem REFS -DriveLetter F -ResiliencySettingName Mirror -Size 10GB -StoragePoolFriendlyName "Storage Pool for Site 1"
    
  3. Site1 中的 Server1 创建第二个虚拟磁盘 (Disk2):Create a second virtual disk (Disk2) for Server1 in Site1:

    New-Volume -CimSession Server1 -FriendlyName Disk2 -FileSystem REFS -DriveLetter G -ResiliencySettingName Mirror -Size 10GB -StoragePoolFriendlyName "Storage Pool for Site 1"
    
  4. 现在,使 Available Storage 组脱机:Now, take the Available Storage group offline:

    Stop-ClusterGroup -Cluster ClusterS1 -Name 'Available Storage'
    
  5. Available Storage 组移动到 Site2 中的 Server3And move the Available Storage group to Server3 in Site2:

    Move-ClusterGroup -Name 'Available Storage' -Node Server3
    
  6. Site2 中的 Server3 上创建第一个虚拟磁盘 (Disk3):Create the first virtual disk (Disk3) on Server3 in Site2:

    New-Volume -CimSession Server3 -FriendlyName Disk3 -FileSystem REFS -DriveLetter H -ResiliencySettingName Mirror -Size 10GB -StoragePoolFriendlyName "Storage Pool for Site 2"
    
  7. Site2 中的 Server3 上创建第二个虚拟磁盘 (Disk4):And create a second virtual disk (Disk4) on Server3 in Site2:

    New-Volume -CimSession Server3 -FriendlyName Disk4 -FileSystem REFS -DriveLetter I -ResiliencySettingName Mirror -Size 10GB -StoragePoolFriendlyName "Storage Pool for Site 2"
    
  8. 现在,使 Available Storage 组脱机,然后将其移回 Site1 中的服务器之一:Now take the Available Storage group offline and then move it back to one of the servers in Site1:

    Stop-ClusterGroup -Cluster ClusterS1 -Name 'Available Storage'
    
    Move-ClusterGroup -Cluster ClusterS1 -Name 'Available Storage' -Node Server1
    
  9. 使用 Get-ClusterResource cmdlet,确保创建了四个虚拟磁盘卷,每个存储池中两个:Using the Get-ClusterResource cmdlet, ensure that four virtual disk volumes were created, two in each storage pool:

    Get-ClusterResource -Cluster ClusterS1
    
  10. 现在,将 Disk1 添加到群集共享卷:Now add Disk1 to Cluster Shared Volumes:

    Add-ClusterSharedVolume -Name 'Cluster Virtual Disk (Disk1)'
    

你已完成卷的创建,并已准备好设置用于复制的存储副本。You are done creating volumes, and ready to set up Storage Replica for replication.

使用 PowerShell 设置复制Set up replication using PowerShell

使用 PowerShell 为延伸群集设置存储副本时,需要将用于源数据的磁盘添加为群集共享卷 (CSV)。When using PowerShell to set up Storage Replica for a stretched cluster, the disk that will be used for the source data will need to be added as a Cluster Shared Volume (CSV). 所有其他磁盘必须在“可用存储”组中保持为非 CSV 驱动器。All other disks must remain as non-CSV drives in the Available Storage group. 然后,在存储副本创建过程中,这些磁盘将添加为群集共享卷。These disks will then be added as Cluster Shared Volumes during the Storage Replica creation process.

在上一步中,使用驱动器号添加了虚拟磁盘,以使其更易于识别。In the previous step, the virtual disks were added using drive letters to make the identification of them easier. 存储副本是一对一复制,这意味着单个磁盘可复制到另一个磁盘。Storage Replica is a one-to-one replication, meaning a single disk can replicate to another single disk.

步骤 1:验证用于复制的拓扑Step 1: Validate the topology for replication

在开始之前,应长时间运行 Test-SRTopology cmdlet(例如运行几个小时)。Before starting, you should run the Test-SRTopology cmdlet for an extended period (like several hours). Test-SRTopology cmdlet 验证潜在的复制合作关系,并验证本地主机到目标服务器之间的复制合作关系,或远程验证源服务器与目标服务器之间的复制合作关系。The Test-SRTopology cmdlet validates a potential replication partnership and validates the local host to the destination server or remotely between source and destination servers.

此 cmdlet 将验证:This cmdlet will verify that:

  • 可以通过网络访问 SMB,这意味着 TCP 端口 445 和端口 5445 双向开放。SMB can be accessed over the network, which means that TCP port 445 and port 5445 are open bi-directionally.
  • 可以通过 HTTP 在网络上访问 WS-MAN,这意味着 TCP 端口 5985 和 5986 已打开。WS-MAN can be accessed over HTTP on the network, which means that TCP port 5985 and 5986 are open.
  • SR WMIv2 提供程序可供访问并可接受请求。An SR WMIv2 provider can be accessed and accepts requests.
  • 源和目标数据卷存在并且是可写的。Source and destination data volumes exist and are writable.
  • 源和目标日志卷存在,进行了 NTFS 格式化或 ReFS 格式化并有足够的可用空间。Source and destination log volumes exist with NTFS formatting or ReFS formatting and sufficient free space.
  • 存储以 GPT 格式而不是 MBR 格式初始化,具有匹配的扇区大小。Storage is initialized in GPT format, not MBR, with matching sector sizes.
  • 有足够的物理内存用来运行复制。There is sufficient physical memory to run replication.

此外,Test-SRTopology cmdlet 还会度量:In addition, the Test-SRTopology cmdlet will also measure:

  • ICMP 的往返延迟,并报告平均值。Round-trip latency of ICMP and report the average.
  • 写入输入/输出的性能计数器,并报告该卷上观察到的平均值。Performance counters for write Input/Output and report the average seen on that volume.
  • 估计的初始同步时间。Estimated initial synchronization time.

在 Test-SRTopology 完成后,它将在你的 Windows Temp 文件夹中创建一个 .html 文件(包含日期和时间的 TestSrTopologyReport)。Once Test-SRTopology completes, it will create an .html file (TestSrTopologyReport with date and time) in your Windows Temp folder. 应当查看任何警告或故障,因为它们可能会导致无法正确创建存储副本。Any warning or failures should be reviewed as they could cause Storage Replica to not be properly created.

下面是一个将运行 5 小时的示例命令:An example command that would run for 5 hours would be:

Test-SRTopology -SourceComputerName Server1 -SourceVolumeName W: -SourceLogVolumeName X: -DestinationComputerName Server3 -DestinationVolumeName Y: -DestinationLogVolumeName Z: -DurationInMinutes 300 -ResultPath c:\temp

步骤 2:创建复制合作关系Step 2: Create the replication partnership

现在,你已完成了 Test-SRTopology 测试,可以配置存储副本并创建复制合作关系了。Now that you completed the Test-SRTopology tests, you are ready to configure Storage Replica and create the replication partnership. 在某个 nutshell 中,我们将通过以下方式来配置存储副本:为每个站点创建复制组 (RG),然后为 Site1 中的源服务器节点(Server1、Server2)和 Site2 中的目标(已复制)服务器节点(Server3、Server4)指定数据卷和日志卷。In a nutshell, we will configure Storage Replica by creating replication groups (RG) for each site and specifying the data volumes and log volumes for both the source server nodes in Site1 (Server1, Server2) and the destination (replicated) server nodes in Site2 (Server3, Server4).

让我们开始以下操作:Let's begin:

  1. 将 Site1 数据磁盘添加为群集共享卷 (CSV):Add the Site1 data disk as a Cluster Shared Volume (CSV):

    Add-ClusterSharedVolume -Name "Cluster Virtual Disk (Site1)"
    
  2. “可用存储”组应该归它当前所在的节点“所有”。The Available Storage group should be "owned" by the node it is currently sitting on. 可以使用以下命令将组移动到 Server1:The group can be moved to Server1 using:

    Move-ClusterGroup -Name "Available Storage" -Node Server1
    
  3. 若要创建复制合作关系,请使用 New-SRPartnership cmdlet。To create the replication partnership, use the New-SRPartnership cmdlet. 此 cmdlet 还可用于指定源数据卷和日志卷名称:This cmdlet is also where you specify the source data volume and log volume names:

    New-SRPartnership -SourceComputerName "Server1" -SourceRGName "Replication1" -SourceVolumeName "C:\ClusterStorage\Disk1\" -SourceLogVolumeName "G:" -DestinationComputerName "Server3" -DestinationRGName "Replication2" -DestinationVolumeName "H:" -DestinationLogVolumeName "I:"
    

New-SRPartnership cmdlet 在两个站点的两个复制组之间创建复制合作关系。The New-SRPartnership cmdlet creates a replication partnership between the two replication groups for the two sites. 在此示例中,Replication1 是 Site1 中主要节点 Server1 的复制组,Replication2 是 Site2 中目标节点 Server3 的复制组。In this example Replication1 is the replication group for primary node Server1 in Site1, and Replication2 is the replication group for destination node Server3 in Site2.

现在,存储副本将设置所有内容。Storage Replica will now be setting everything up. 如果存在任何要复制的数据,它将在此处进行复制。If there is any data to be replicated, it will do it here. 这可能需要一些时间,具体取决于需要复制的数据量。Depending on the amount of data it needs to replicate, this may take a while. 在此过程完成之前,建议不要移动任何组。It is recommended to not move any groups around until this process completes.

后续步骤Next steps

若要了解相关的主题和其他存储管理任务,另请参阅:For related topics and other storage management tasks, see also: