first) Introduce
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
DFS Replication is a feature that allows two or more servers to synchronize data with each other, according to the Multi-master model. Supports replication scheduling and replication bandwidth throttling.
Use Remote Differential Compression (RDC) protocol to synchronize data on the transmission line. When there is a change in data, RDC will only replicate the changed data, not completely replicate a new file. Significantly saves bandwidth.
2) Structure of DFS Replication
- Replication group: is a group containing server members, replicating one or more folders together.
- Replicate folders: are folders containing data that will be replicated to servers in the group, these replicated folders are always synchronized between servers.
- In the first time setting up Replication, we have a machine as the Primary member, which is the machine that contains the data that you want to replicate to other servers in the group.
- In the replication group, we can configure some parameters such as: schedule replication periodically, replicate bandwidth.
3) DFS Replication setup process
1) After you finish configuring replication on DFS Server, the system will not set up replication immediately. This configuration information will be sent to all Domain Controller machines, then Replication team members will go to the DC machine to get this information.
2) After having configuration information, other members will go to Primary member to get data, if any member gets all data from Primary member first, it will automatically replicate to other members. is different.
3) When all members have fully received Primary member’s data, then the replication setup process has also been completed. At this point, the Primary member will no longer be defined, but all members are equal. If any member’s data changes, it will immediately replicate to other members of the group.
4) New feature of DFS Replication on WS 2012 R2
- Database cloning for initial sync (New): The Database Cloning feature allows administrators to export data and storage structures to a .xml configuration file (Export-DfsrClone ) on the Primary member then allow to bring this data and .xml file to other members to import (Import-DfsrClone). This helps to optimize replication time and synchronization time between Primary member and other members
- Data Corruption recovery (New): In previous versions, if DFS Replication detects that a member’s data is corrupted (corrupt), it will automatically delete that data on the member and perform the replication again. In Windows Server 2012 R2, DFS Replication does self-correction by scanning and detecting where the data is corrupted, then it only needs to update those parts.
- Cross file RDC Disable (New): is a feature that improves the RDC protocol for replication. It filters out the changes in more detail. Helps to maximize replication bandwidth, but in return requires more CPU and Disk computing.
- File Staging Tuning (New): Each member will have a Staging queue. This queue is used to organize your own replication data and send it to other members. Default 1 block of data in the queue is 256KB, can be configured higher.Staging also supports compression. Can use the command Set-DfsrMembership –MinimumFileStagingSize to reconfigure the data block.
- Preserved file restoration (New): Allows recovery of files in Existing, Conflict and Deleted folders.
- Unexpected shutdown database recovery improvement (Updated): The sudden server failure leads to data loss and leads to errors (corrupt). Windows Server 2012 R2 will detect and automatically check for and recover corrupted data
- Membership disabling improvements (Updated): When you detach a member from the replication group, this member automatically deletes the folders located in DfsrPrivate (including Staging,conflict and deleted, preexisting). In Windows Server 2012 R2 it is allowed to keep these folders
5) Replication Deployment Model
- Hub and Spoke topology: There can be one or more servers as Hub, and the servers located in the branch will do Spoke. Hub Server’s data will be replicated to Spoke Servers, and vice versa. Spoke servers will not be allowed to replicate data. Everything has to go through the Hub as an intermediary.
- Full mesh topology: servers will be allowed to replicate each other. For example, when there is a file on a certain server, it will replicate that file to all other members.
- Custom topology: customizable, can combine Full mesh and Hub and Spoke together. One Server is the total Hub and the branches are the Spoke, then the Spoke Servers will configure the Full mesh for each other.
6) Lab deployment
Model deployment:
- AD (172.1.1./24) : Domain controller machine (Huypd.com).
- FS1: File Server 1 machine (172.1.1.2/24), which is the Primary Server, replicates the folder named “Public Data FS1”.
- FS2: File Server 2 machine (172.1.1.3/24), containing Replicate data in the folder “Replication Data Software and New”.
- FS3: File Server 3 machine (172.1.1.4/24), containing Replicate data in the folder “Public Data FS1”.
- Description: the deployment model is Full Mesh, configure Replicate between FS1 and FS2 using the interface, continue to implement the “Database cloning for initial sync” feature to export and import data from FS1 to FS3, then execute add FS3 to the Replication group using the shell command.
Perform:
- On machine FS1, create a folder “Public Data FS1” containing data. Machine FS2, create folder “Replication Software and News”.
- Install DFS Replication feature for all 3 File Server machines. (Server Manager -> Add roles and features -> File and Storage Services -> DFS Replication”.
- After installing the DFS Replication feature, create a Replication Group. Right-click -> New Replication Group
- Name the Replication Group “Replication News and Projects”
- Declare 2 Servers, FS1 and FS2.
- Select model (this lab is Full mesh)
- Select bandwidth for replication
- Select server FS1 as Primary member
- Select the replicate folder on the FS1 server. Here is the folder “Public Data FS1”
- On the FS2 server, click Edit. Select the folder to receive replicated data, here is the folder “Replicate Software and New”
- After completing the configuration process, the system will now proceed to set up Replication
Configure DFS Replication for FS3 with the new feature “Database Cloning for initial replication”
- On the FS1 machine, open Windows PowerShell. Type command Export-DfsrClone –Volume C: –Path “C:\Dfsrclone” to proceed to export the .xml file containing the structure of the drive and information about the configuration of DFS Replication.
- Next, on the FS1 server, we output the data in Public Data FS1 with the commandRobocopy.exe “C:\Public Data FS1” “”\\fs3\c$\Public Data FS1” /E /B /COPYALL /R:6 /W:5 /MT:64 /XD DfsrPrivate /TEE /LOG+:Preseed.log
- /E : copy the whole subdirectory, /Copyall : copy all information and properties of the file, /R: number of times to copy if it fails, /W: time to wait to re-copy, /MT : creates multiple copy streams, /TEE : outputs the output to the console, /LOG : records the execution in a Log file.
- At this time, the FS3 Server side has a Public Data FS1 folder and data.
- On Server FS1, execute the command Robocopy.exe C:\DfsrClone\\FS3\C$\DfsrClone /B . Copy the DfsrClone folder to FS3.
- After executing the above command, the DfsrClone folder is already on FS3 on C drive
- On FS3, Import information in DfsrClone into the DFS Replication role, done with 2 commands:
- RD “C:\System Volume information\dfsr” –Force –Recurse , delete the Dfsr folder (if exists in the system) before importing into .
- Import-DfsrClone –Volume C: –path “C:\DfsrClone” , Import the information in the DfsrClone folder into DFS Replication.
- Next, use the Shell command to Add the FS3 machine to the Replication group “Replication News and Projects”.
- Add-DfsrMember –GroupName “Replication News and Projects” –ComputerName “FS3” | Set-DfsrMembership -FolderName “Public Data FS1” –ContentPath “C:\Public Data FS1”
- Execute the next command Add-DfsrConnection –GroupName “Replication News and Projects” –SourceComputerName “FS1” –DestinationComputerName “FS3” , This command creates a DFS Replication Connection that connects FS3 with the other 2 servers, and declares FS1 as Primary Member to proceed for the initial replication setup process.
- Check again, now in the Replication Group has fully connected members and connections or not. If there is enough, then FS3 will now perform the process of setting up Replication with FS1.