叢集對叢集儲存體複寫Cluster to cluster Storage Replication

適用於:Windows Server (半年度管道)、Windows Server 2016Applies to: Windows Server (Semi-Annual Channel), Windows Server 2016

現在可於 Windows Server 2016 Datacenter Edition 中使用叢集對叢集複寫,包括使用儲存空間直接存取來複寫叢集 (也就是不共用,直接連結存放裝置)。Cluster-to-cluster replication is now available in Windows Server 2016 Datacenter Edition, including the replication of clusters using Storage Spaces Direct (i.e. shared nothing, direct-attached storage). 管理與設定類似於伺服器對伺服器複寫。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.

Windows Server 2016 Datacenter Edition 中沒有圖形化工具可設定儲存體複本進行叢集對叢集複寫,不過 Azure Site Recovery 未來將能夠設定此案例。There are no graphical tools in Windows Server 2016 Datacenter Edition that can configure Storage Replica for cluster-to-cluster replication, though Azure Site Recovery will be able to configure this scenario in the future.

重要

這項測試中的四部伺服器即為範例。In this test, the four servers are an example. 您可以在每個叢集中使用 Microsoft 支援之任意數目的伺服器,目前儲存空間直接存取叢集支援 16 個,而共用存放裝置叢集支援 64 個。You can use any number of servers supported by Microsoft in each cluster, which is currently 16 for a Storage Spaces Direct cluster and 64 for a shared storage cluster.

本指南並未涵蓋設定儲存空間直接存取的內容。This guide does not cover configuring Storage Spaces Direct. 如需設定儲存空間直接存取的資訊,請參閱 Windows Server 2016 中的儲存空間直接存取For information about configuring Storage Spaces Direct, see Storage Spaces Direct in Windows Server 2016.

本逐步解說使用下列環境做為範例: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).
  • 至少在四部伺服器 (兩個叢集各有兩部伺服器) 安裝 Windows Server 2016 Datacenter Edition。At least four servers (two servers in two clusters) with Windows Server 2016 Datacenter Edition installed. 最多可支援兩個各有 64 節點的叢集。Supports up to two 64 node clusters.
  • 兩組存放裝置,使用 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 寫入工作負載,以及平均 =5ms 的來回延遲。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.

這其中許多需求都可以使用 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 2016 Datacenter (桌面體驗) 的安裝類型,在所有四個伺服器節點上安裝 Windows Server 2016。Install Windows Server 2016 on all four server nodes with an installation type of Windows Server 2016 Datacenter (Desktop Experience). 請不要選擇標準版 (如果有的話),因為當中不包含儲存體複本。Do not choose Standard Edition if it is available, as it does not contain Storage Replica.

  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.
    • 記錄磁碟區預設必須至少有 9 GB,而且根據記錄需求,可能會更大或更小。The log volume must be at least 9GB by default and may be larger or smaller based on log requirements.
    • 對於 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. 遵循在獨立伺服器上部署儲存空間中提供的步驟 1-3,使用 Windows PowerShell 或伺服器管理員,使用儲存空間佈建儲存體。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/en-us/windows-server/storage/storage-spaces/hyper-converged-solution-using-storage-spaces-direct)(https://docs.microsoft.com/en-us/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.

  9. 啟動 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: 磁碟區長達五分鐘的少量 IO 工作負載範例︰For 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

  10. 檢查 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 2016 RSAT 管理工具的遠端管理電腦,執行下列所有步驟。You can perform all of the steps below on the cluster nodes directly or from a remote management computer that contains the Windows Server 2016 RSAT management 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 2016 現在包含雲端 (Azure) 見證選項。Windows Server 2016 now includes an option for Cloud (Azure)-based Witness. 您可以選擇此仲裁選項,而不是檔案共用見證。You can choose this quorum option instead of the file share witness.

    警告

    如需仲裁設定的詳細資訊,請參閱設定和管理 Windows Server 2012 容錯移轉叢集中的仲裁中的<見證設定>一節。For more information about quorum configuration, see the Witness Configuration section in Configure and Manage the Quorum in a Windows Server 2012 Failover Cluster. 如需 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 2016 現在包含雲端 (Azure) 見證選項。Windows Server 2016 now includes an option for Cloud (Azure)-based Witness. 您可以選擇此仲裁選項,而不是檔案共用見證。You can choose this quorum option instead of the file share witness.

    警告

    如需仲裁設定的詳細資訊,請參閱設定和管理 Windows Server 2012 容錯移轉叢集中的仲裁中的<見證設定>一節。For more information about quorum configuration, see the Witness Configuration section in Configure and Manage the Quorum in a Windows Server 2012 Failover Cluster. 如需 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 2016 RSAT 管理工具的遠端管理電腦,執行下列所有步驟You can perform all of the steps below on the nodes directly or from a remote management computer that contains the Windows Server 2016 RSAT management tools

  1. 在第一個叢集的任何節點上,或從遠端執行 Grant-ClusterAccess Cmdlet,將第一個叢集的完整存取權授與另一個叢集。Grant the first cluster full access to the other cluster by running the Grant-ClusterAccess cmdlet on any node in the first cluster, or remotely.

    Grant-SRAccess -ComputerName SR-SRV01 -Cluster SR-SRVCLUSB  
    
  2. 在第二個叢集的任何節點上,或從遠端執行 Grant-ClusterAccess Cmdlet,將第二個叢集的完整存取權授與另一個叢集。Grant the second cluster full access to the other cluster by running the Grant-ClusterAccess 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 的結果,您可能會決定以較高或較低的值來使用 -LogSizeInBytesDepending 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}`r", $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 2016 RSAT 管理工具的遠端管理電腦,執行下列所有步驟。You can perform all of the steps below on the cluster nodes directly or from a remote management computer that contains the Windows Server 2016 RSAT management tools.

  1. 使用 Get-ClusterGroupFailover Cluster Manager,判斷目前的複寫來源與目的地,還有其狀態。Use Get-ClusterGroup or Failover Cluster Manager to determine the current source and destination of replication and their status.

  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 2016 不會阻止角色切換,因為如果您尚未完成初始複寫,即嘗試切換,可能會導致資料遺失。Windows Server 2016 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. 若要在 Windows Server 2016 中變更預設的 8 GB 記錄檔大小,請在來源和目的地儲存體複本群組上使用 Set-SRGroupTo change the log size from the default 8GB in Windows Server 2016, 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.

請參閱See also