建立延伸的叢集磁片區並設定複寫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. 在 [ Advanced] 下,選擇性地執行下列動作: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. 在右窗格中,確認您的主要 (active) 網站中已建立資料磁片和記錄磁片,而且對應的資料和記錄複本磁片是在次要 (被動) 網站中建立。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-ClusterGroupCmdlet 會用來進行這項工作。The Move-ClusterGroup cmdlet is used to this.

  1. 首先, Available Storage 使用 Cmdlet 將存放集區資源群組移至 Server1Site1 Move-ClusterGroupFirst 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. 接下來,在中建立第一個虛擬磁片 (Disk1) Server1 Site1Next, 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. 在中建立第二個虛擬磁片 (Disk2 的) Server1 Site1Create 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 群組移至 Server3Site2And move the Available Storage group to Server3 in Site2:

    Move-ClusterGroup -Name 'Available Storage' -Node Server3
    
  6. 在中建立第一個虛擬磁片 (Disk3) Server3 Site2Create 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. 並在中建立第二個虛擬磁片 (Disk4) Server3 Site2And 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 群組離線,然後將它移回其中一部伺服器 Site1Now 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-ATOMICTRANSACTION,這表示 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.

一旦測試完成後,它會建立一個 .html 檔案 (TestSrTopologyReport,在您的 Windows 暫存資料夾中) 日期和時間。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. 總而言之,我們會為每個網站建立 (RG) 的複寫群組,並為 (Site1 中的來源伺服器節點指定資料磁片區和記錄磁片區) (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:"
    

此 Cmdlet 會在兩個 New-SRPartnership 網站的兩個複寫群組之間建立複寫合作關係。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: