Thursday, August 6, 2009

Windows Server 2008 DFS Share Replication for Redundancy

The DFS (Directory file Service) File Services Role ships on all editions of Windows Server 2008 except for the Web and IA editions. You install the DFS role on Server 2008 using the “Server Manager” and you install the “File Services” role using the “Add Roles Wizard”, be sure to choose DFS Replication under the File Server role. Next install the DFS Management Console this feature can be installed using “Server Manager” by selecting “Add Features” and then choosing “Remote Server Administration Tools” in the list of available features.

The DFS management console is used to configure the DFS replication. This is the tool that will allow us to setup a DFS namespace and configure the replication of files between multiple shares. A DFS namespace is a place where you have a list of all your file shares in DFS and is basically a folder structure of a list of file shares. As far as users are concerned they have no idea they may be navigating across multiple server to access files.

There are two types of namespaces, domain based and stand alone, if you are running Active Directory you should use a domain based namespace. This will store the namespace configuration in Active Directory and will be redundant across all domain controllers. Create the namespace in DFS Management Console. Click on the right to add a namespace and launch the wizard, name the namespace, then choose domain based in 2008 mode click to create, and then close.

After you create the namespace you will need to add folders to it, click “new folder” on the right and enter a name such as “Sales”. Click to add an associated folder (This will be a preconfigured share on a server). You can also add folders with no targets just to help create a hierarchy in the namespace for organization purposes.

Now the whole purpose of this is to have multiple targets, which is multiple copies of the same data stored on multiple servers, (maybe in separate physical locations) in order to have fault tolerance or to speed access to data across slower WAN links. It is very simple to add multiple targets just make sure you provide the multiple targets for the namespace when you are configuring it. So if we are using a domain based Active Directory integrated DFS the clients will be automatically redirected to the location that is physically closest to them.

Now the only thing left is to setup a DFS replication group so that our data is synchronized between all the servers. We are going to use DFS-R or Distributed File System Replication, this will work for both domain based and stand alone DFS. We need to create a replication group, only changes to the files are sent across the LAN/WAN not the entire changed file this helps save bandwidth. Start the “Replicate Folder Wizard” type the name of the replication group and the name of the folder to replicate, in our case “Sales”. Chose the servers you want to replicate between and chose which server will act as the primary member, and then choose the topology, I prefer Full Mesh as I prefer each member to replicate will all other members of the replication group. Next if you wish you can limit the bandwidth and schedule replication times.

The end result is you have multiple servers with “mirrored” shares in multiple locations that update each other in real time as a user changes a file in a single location. This is also very useful for fault tolerance in a single location…

*If your domain is in Server domain functional level, the system uses DFS-R for SYSVOL replication. If your domain is in any other domain mode, there might be non-Server 2008 domain controllers, a server may replicate with a non 2008 server that does not support DFS-R. Therefore, the system uses FRS on all domain controllers.