Installation and configuration of replica storage


Windows Server 2019

Storage replication (storage replica) is a feature that comes with Windows Server 2016 that lets you replicate a volume to another server. To work the feature requires two volumes per server. The first for storing data and the second for logs.

Storage replica

Storage replica works on the principle Active / Passive. The data is accessible only from the source node, on the destination it is not possible to access the same disk connect locally on the server.

It is possible to reverse the direction of replication in case of failover.

There are two modes of replication:

  • Synchronous: when writing a data it is done simultaneously on both servers, the acknowledgment of the writing of the data must be made on both servers.
1. The application writes data
2. The log data is written and the data is replicated to the remote site
3. The log data is written to the remote site
4. Acknowledgment of receipt of the remote site
5. Receipt of confirmed application writingt& t1: data emptied on the volume, logs always written continuously

Source Microsoft

  • Asynchronous: the data is initially written to the source server and then to the replication server.
1. The application writes data
2. Journal data written
3. Receipt of confirmed application writing
4. Replicated data at the remote site
5. Log data written on the remote site
6. Acknowledgment of reception of the remote site
t& t1: data emptied on the volume, newspapers always written continuously

Source Microsoft

The Storage Replication feature does not have an administrative console, the configuration is done using PowerShell or Admin Center. If you are using the SR as part of a cluste, you can do the configuration using the Failover Clustering Console.

Prerequisites

To put in the functionality it is necessary:

  • Two Windows 2016/2019 servers with:
    • Fixed ip address
    • Member of the same domain
    • A partition for the data
    • A partition for logs in production predict 10GB
  • Make sure the hosts contact each other by their NETBIOS name
  • Open Port Communication 445/5445
servers
Disks

In order to ease server administration for role installation, I added both servers in the domain controller’s server manager.

Installing the Feature: Storage Replication

1. From the server manager, click Manage 1 / Add Roles and Features 2 .

Server manager

2. When launching the wizard, click Next 1 .

install feature wizard

3. Choose Role Based Installation or 1 Feature and click Next 2 .

installation type

4. Select the server where the installation is to be done 1 and click Next 2 .

Select server

5. Skip the list of roles by clicking Next 1 .

roles list

6. Check the Replica box of storage system 1 .

7. Confirm adding additional tools by clicking Add Features 1 .

Add features

8. The feature checked, click Next 1 .

selected feature

9. Confirm the installation by clicking the Install 1 button.

start the installation

10. Wait during the installation …

11. Once installed, exit the wizard by clicking Close 1 .

installation completed

12. The feature requires a server restart. Restart the server.

Reboot server

13. Install on the second server.

Installation on the second server

Configure replication in PowerShell

1. On the source server, open a PowerShell command prompt in Administrator and enter the following command:

New-SRPartnership -SourceComputerName LAB-FIC1 -SourceRGName rg01 -SourceVolumeName D: -SourceLogVolumeName L: -DestinationComputerName LAB-FIC1-SR -DestinationRGName rg02 -DestinationVolumeName D: -DestinationLogVolumeName L: -LogSizeInBytes 2GB

Explanation:

-SourceComputerNameNetbios name of the source server
-SourceRGNameName of the source replication group
-SourceVolumeNameVolume (s) to replicate
-SourceLogVolumeNameVolume of the source logs
-DestinationComputerNameNetbios name of the destination server
-DestinationRGNameDestination replication group name
-DestinationVolumeNameReplica Volume (s)
-DestinationLogVolumeNameDestination logs volume
-LogSizeInBytesLog size (default: 8GB)

Result of the command:

DestinationComputerName : LAB-FIC1-SR
DestinationRGName       : rg02
Id                      : 2856278e-643f-49c7-9842-b25aabb5a70e
SourceComputerName      : LAB-FIC1
SourceRGName            : rg01
PSComputerName          :

2. Go to the destination server, the replicated drive should no longer be available in the interface.

replica volume unavailable

Managing replication on a group server

Show Bytes to replicate

(Get-SRGroup).Replicas | Select-Object NumOfBytesRemaining 0

Result:

NumOfBytesRemaining
-------------------
                  0

View the last 20 entries of Windows events

Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica -max 20

Result :

   ProviderName : Microsoft-Windows-StorageReplica

TimeCreated                     Id LevelDisplayName Message
-----------                     -- ---------------- -------
DD/MM/YYYY 09:51:47           5015 Information      Connexion établie avec un réplica partenaire....
DD/MM/YYYY 09:51:43          10442 Information      Une modification d'état de partition a entraîné une mise à jour ...
DD/MM/YYYY 09:51:43           5002 Information      La source est entrée dans l'état prêt....
DD/MM/YYYY 09:51:43           5004 Information      La source est entrée dans l'état d'attente de quorum....
DD/MM/YYYY 09:51:43           1237 Information      La copie de bloc est en cours....
DD/MM/YYYY 09:51:43           1201 Information      Préparation pour réplication de la source terminée....
DD/MM/YYYY 09:51:43           5001 Information      Entrée dans l'état de préparation....
DD/MM/YYYY 09:51:43           2231 Information      Le groupe de réplication est en ligne....
DD/MM/YYYY 09:51:43           2200 Information      Démarrage de la réplication pour le réplica....
DD/MM/YYYY 09:51:32          10330 Information      Une partition GPT a été détecté et préparée pour des opérations ...
DD/MM/YYYY 09:51:32          10330 Information      Une partition GPT a été détecté et préparée pour des opérations ...
DD/MM/YYYY 09:51:32          10002 Information      Pilote de filtre démarré.
DD/MM/YYYY 09:51:24           2202 Information      Arrêt de la réplication pour le réplica....
DD/MM/YYYY 09:51:24          10440 Information      Une modification d'état de partition a entraîné une mise à jour ...
DD/MM/YYYY 09:50:08          10003 Information      La mémoire est désormais disponible....
DD/MM/YYYY 09:50:07          10004 Avertissement    La mémoire disponible est insuffisante....
DD/MM/YYYY 09:50:07          10003 Information      La mémoire est désormais disponible....
DD/MM/YYYY 09:50:07          10004 Avertissement    La mémoire disponible est insuffisante....
DD/MM/YYYY 09:50:03          10003 Information      La mémoire est désormais disponible....
DD/MM/YYYY 09:50:02          10004 Avertissement    La mémoire disponible est insuffisante....

Event Viewer

The logs are available in the following location: Applications and Services Logs / Microsoft / Windows / StorageReplica.

observer events

Reverse the direction of replication (failovers)

To reverse the direction of replication, enter the following command in PowerShell:

Set-SRPartnership -NewSourceComputerName LAB-FIC1-SR -SourceRGName rg02 -DestinationComputerName LAB-FIC1 -DestinationRGName rg01

The order requires confirmation

Delete replication

To remove the replication, enter the following command in PowerShell:

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

Deletion can be performed on the remaining node to failover if the source server is down.

Replication Management with the Admin Center

1. From the Admin Center, go to a server in the replication group and click on Replica Storage 1 .

Admin center

2. Select a partnership to have the information.

overview storage replica

It is possible to reverse the direction of replication from the Admin Center, select the partnership, and click Change Direction.

3. Management of replicated volumes

Volume

4. Event observer

Logs

Conclusion

The Storage Replica feature is a good alternative to DFS-R replication for file servers that provides real-time data replication but requires manual intervention to failover and requires a namespace user not to have the shares to reconfigure.

This article gives you an overview of the functionality, it is possible to set it up between two hyper-v clusters for the implementation of a PRA.




Leave a Comment