Настройка dfs репликации windows server 2016

DFS - Distributed File System - распределенная файловая система. Устанавливаем. Создаем пространство имен DFS. Добавляем новый каталог в существующее пространство имен. Настраиваем DFS-репликацию.

Рано или поздно системные администраторы задаются вопросом о децентрализованном хранении информации или хотя бы об объединении нескольких существующих файловых серверов в единый. Параллельно этому поднимается вопрос о безопасности хранимой информации. Относительно простым, менее затратным и популярным среди администраторов AD (Active Directory) является использование DFS. Рассмотрим что это и как настроить.

DFS — Distributed File System — распределенная файловая система. Является продуктом компании Microsoft, предназначенный для упрощения доступа  пользователей к файлам. Что примечательно, файлы могут быть разнесены территориально.

Выделяют два типа DFS:
1. Namespace DFS (Пространство имен DFS). Данный тип реализует виртуальное дерево, которое объединяет общие каталоги сети в единое пространство имен. Существует возможность настройки нескольких пространств имен.
2. Replication DFS (Репликация DFS) — репликация уже существующего каталога с отслеживанием содержимого и внесенных изменений.

Установка (DFS Installation)

Сразу заострим внимание, что установку, в рамках данного примера, будем выполнять на уже настроенный контроллер домена.

Открываем диспетчер серверов. В основной части окна кликаем по «Добавить роли и компоненты»:

В новом окне переходим к пункту «Тип установки», выбираем параметр «Установка ролей и компонентов», нажимаем кнопку «Далее»:

В обновленном окне выбираем текущий сервер и кликаем по кнопке «Далее»:

Следующим шагом, в списке доступных ролей находим «Файловые службы и службы хранилища» и раскрываем список, в котором необходимо отыскать «Файловые службы и службы iSCSI». Также раскрываем список параметров. Отмечаем галочками «Пространства имен DFS» и «Репликация DFS». В появившемся окне кликаем «Добавить компоненты». Нажимаем кнопку «Далее» несколько раз и дожидаемся окончания установки:

Создание пространства имен DFS

Перед тем, как приступить к созданию пространства имен DFS, необходимо создать хотя бы одну сетевую директорию на любом из серверов входящих в домен. В нашем случае будем использовать директорию созданную на том же контроллере домена.

Для того чтобы папка стала доступна из сети, кликаем по ней правой кнопкой мыши, в контекстном меню выбираем «Поделиться», затем «Отдельные люди»:

В поле ввода указываем «Пользователи домена», нажимаем кнопку «Добавить», затем «Поделиться»:

Общий доступ к папке готов. Кликаем по кнопке «Готово»:

Теперь сервер доступен по пути:
WINSERVER2019net_share

Создадим пространство имен DFS.

Для этого в меню «Пуск» выбираем «Средства администрирования Windows». Также можно через Панель управленияСистема и безопасностьАдминистрирование.

В открывшемся окне, выбираем «Управление DFS»:

В новом окне «Управление DFS», в правой части кликаем по «Новое пространство имен …»:

В окне мастера указываем имя сервера. Его можно отыскать как в окне, которое откроется при клике по кнопке «Обзор», так и в свойствах системы на вкладке «Имя компьютера». Нажимаем «Далее»:

Следующим шагом указываем имя пространства имен. В нашем случае, пусть будет «MyDFS». Нажимаем кнопку «Изменить настройки…». В новом окне следует обратить внимание на строку «Локальный путь общей папки», при необходимости измените его. В том же окне установим переключатель на значение «Использовать пользовательские разрешения» и кликаем кнопку «Настроить»:

В открывшемся окне разрешаем полный доступ для всех и нажимаем кнопку «OK»:

Окно изменения настроек закрываем кликом по кнопке «OK», в окне мастера нажимаем кнопку «Далее»:

На новом этапе выбора типа пространства имен устанавливаем переключатель на значение «Доменное пространство имен», нажимаем кнопку «Далее».

Внимательно просматриваем настройки. Все устраивает — нажимаем «Создать»:

В случае успеха мастер покажет следующее окно:

Нажимаем кнопку «Закрыть».

Добавляем новый каталог в существующее пространство имен

Смысла в проделанном выше нет, если не добавить каталоги к уже существующему пространству имен. В примере процесс будет выполнен на том же сервере, однако, метод применим ко всем серверам в домене.

В окне управления DFS, в левой его части, разворачиваем дерево управления DFS до существующего, кликаем по необходимому. В правой части окна, в разделе действий, выбираем «Создать папку…»:

В открывшемся окне «Создание папки» указываем имя, в нашем случае «Test» и нажимаем кнопку «Добавить»:

В новом окне необходимо добавить путь к существующей сетевой папке. Список доступных каталогов можно посмотреть кликнув по кнопк «Обзор…». По окончании, нажимаем «OK»:

Результат будет таким:

Нажимаем «OK».

Доступ к DFS можно получить из любой адресной строки (Пуск->Выполнить, или из адресной строки любой папки) по шаблону:
<доменное_имя_сервера><имя_пространства_имен_DFS>

Например:
laa.testMyDFS

Результат таков:

Настройка DFS-репликации

Для выполнения репликации данных необходимо добавить второй сервер в этот же домен и установить на нем роль сервера «Репликация DFS» с помощью диспетчера серверов:

На этом же сервере создаем папку и разрешаем общий доступ к ней. В эту папку будут реплицироваться данные из директории, расположенной на сервере контроллера домена:

При открытии доступа и позже, в меню свойств папки можно увидеть сетевой путь до каталога:

Возвращаемся к контроллеру домена и развернутому на нем пространству имен DFS. Открываем уже знакомое из примеров выше окно «Управление DFS». В левой части окна, разворачиваем дерево до созданного пространства имен. В правой части окна выбираем «Добавить конечный объект папки…». В новом окне вводим адрес до общего каталога на другом сервер (который создали ранее). Нажимаем кнопку «OK»:

Система задаст вопрос желании создать группу репликации. Нажимаем кнопку «Да»:

Дожидаемся окончания хода выполнения. Итогом будет открытое окно «Мастера репликации папок». Необходимо проверить имя группы репликации, а также имя каталога, который будет реплицирован. Переходим к следующему шагу кликнув по кнопке «Далее»:

На данном этапе проверяем пути до сетевых каталогов и нажимаем «Далее»:

Следующим шагом предстоит выбрать основной узел из выпадающего списка. Это тот узел с которого данные будут реплицироваться. В случае с примером, основной член репликации сервер с именем WINSERV2016 — это сервер, на котором поднят контроллер доменов. Конкретный пример, лишний раз напоминает о необходимости определения понятных имен для серверов и прочих узлов сети. Нажимаем «Далее»:

Теперь предстоит выбрать топологию подключений между членами репликации. Выбираем доступную — «Полная сетка», однако если вы желаете создать свою топологию репликации позже, то выбирайте «Нет топологии». Нажимаем «Далее»:

Настройка подходит к концу и на этом шаге следует определиться с периодичностью репликации данных. Выбираем вариант с постоянной репликацией. Преимущества этого метода в том, что данные будут дублироваться сразу. Недостаток — нагружает локальную сеть при больших объемах информации, а также нагрузка на жесткий диск.

Второй вариант, предлагает настроить репликацию по расписанию. Минус этого способа в том, что данные будут синхронизированы «потом». Выбираем желаемый вариант и нажимаем «Далее»:

Программа предлагает просмотр выбранных параметров. Если все устраивает — нажимаем кнопку «Создать»:

В случае успеха результат будет таким:

Нажимаем кнопку «Закрыть».

Система напомнит о задержках репликации. Чтобы не получать это сообщение вновь, при желании, следует установить галочку в соответствующем месте. Нажимаем кнопку «OK»:

Настройку распределенной файловой системы, а также репликацию данных можно считать оконченной.

220140
Минск
ул. Домбровская, д. 9

+375 (173) 88-72-49

700
300

ООО «ИТГЛОБАЛКОМ БЕЛ»

220140
Минск
ул. Домбровская, д. 9

+375 (173) 88-72-49

700
300

ООО «ИТГЛОБАЛКОМ БЕЛ»

This manual describes how to configure DFS data replication in the Active Directory domain on servers running Windows Server 2016.

There are two types of Distributed File System (DFS):

  1. Namespace DFS — DFS allows you to create virtual directory trees that unite shared folders across the corporate network. It is possible to configure multiple DFS namespaces. It uses simplified user access to geographically distributed files;
  2. Replication DFS — creates a replicated shared folder and tracks changes in files.

Installing DFS Namespaces and DFS Replication Roles on Windows Server 2016

Let’s install the DFS Namespaces and DFS Replication roles on the two servers running Windows Server 2016 between which the replication will be configured.

dfs replication

Use the DFS Management console (dfsmgmt.msc) to create a new DFS namespace.
You can create a domain-based namespace or stand-alone namespace.

  • Domain-based namespace — namespace integrated into the AD. Allows you to hide the DFS namespace server name from the users, simplifies the replacement of the namespace server as well as transfer the namespace to another server;
  • Stand-alone namespace — allows you to create DFS structures without using Active Directory Domain Services (AD DS) even in a workgroup. The high availability of the namespace can be achieved using a failover cluster.

windows server 2016 dfs replication

Create a new folder in the new namespace. Make sure that the new directory is accessible over the network by the UNC path dfsnamespacenamefoldername (in our example it is contoso.compublicshareddocs).

setup dfs replication server 2016

Configuring DFS Replication Between 2 Servers Running Windows Server 2016

Now you can configure DFS replication. DFS Replication allows you to synchronize directories with files (replicated folders) between servers that are part of a DFS replication group. The servers within the DFS replication group are connected to each other using DFS connections.

Changes are replicated using the Remote Differential Compression Algorithm (RDC). Only the changed parts of the files are replicated. DFS replication is performed asynchronously, i.e. at a specific point in time, sources may not be consistent.

It is necessary to distinguish between simple FRS replication (File Replication Service) and DFSR (Distributed File System Replication). DFSR appeared in Windows Server 2008, and it became possible to use differential compression when performing some changes in the file, but not the entire file, is transferred over the network. In FRS replication, the entire file is copied.

Note. You can migrate Active Directory replication from FRT to DFS.

DFS replication is advantageous to use folders between remote branches over slow WAN links for replicating.

When communication between replication partners is lost, replication stops. After the network is restored, replication will continue.

A replication group is a set of servers (members) that participate in the replication of one or more folders.

DFS replication system requirements:

  • DFS Replication must be installed on all servers in the replication group;
  • Servers in the replication group must be in the same AD forest;
  • Active Directory forest schema at least Windows Server 2003 R2, domain functional level — at least Windows Server 2008 (check if you need to update Active Directory schema);
  • Replicated directories must be located on volumes with the NTFS file system. ReFS, FAT, and Cluster Shared Volumes are not supported;
  • Anti-virus on DFS servers must be compatible with DFS replication technology, or you must add replicated directories to the antivirus exceptions.

Before configuring replication, you need to add a network shared folder on the second DFS server. Open the DFS Management console, select the desired namespace, and select Add Folder Target from the context menu.

windows dfs replication

Enter the name of the shared folder and click OK (in our example it is \HOST2DFSShareDocs).

dfs replication 2016

You will be prompted to create a new replication group. Click Yes.

configure dfs replication

Tip. If you clicked No, then in the DFS management console right-click on the Replication section and select the New Replication Group to create a new replication group.

In the DFS Replication Configuration Wizard, you need to verify the name of the replication group and the directory you want to replicate.

dfs replication windows server 2016

Check the paths to the shared folders on the servers.

server 2016 dfs replication

Select the primary member node on which the initial data is stored and from which initial replication will be performed.

setup dfs replication

As a rule, Full mesh is selected as the replication topology. In this topology, all changes on one node are immediately replicated to all the others.

dfs replication server 2016

It remains to adjust the schedule and bandwidth that can be used to replicate data. Check the settings and click Create.

A message should appear after the successful creation of a new replication group.

windows 2016 dfs replication

This completes the configuration of the DFS distributed file system and data replication in it.

Try creating a new file in the shared folder on one of the member servers. If the file size is very large, its replication can take several hours or even days, depending on the bandwidth of the communication channel between DFS servers and the DFS replication settings.

dfs windows server 2016

If 2 users simultaneously edit (or create) the same file, then DFS replicates the version of the file that was changed (created) last. An earlier version of the file is stored in DfsrPrivateConflictandDeleted directory on the server that resolves the DFS replication conflict. In this case, an entry about the conflict that has occurred appears in the ConflictandDeletedManifest.xml file.

Tweaking DFS Replication

After creating a DFS replication group, you can change various settings to provide better performance.

In the DFS Management console, expand the Replication section, which contains all the replication groups.

Select the replication group you created. In the right window you will see 4 tabs:

  • Membership — this is a list of network folders between which data is replicated;
  • Connections — describes the topology of relationships between DFS replication partners;
  • Replicated Folders — DFS folder settings;
  • Delegation — replication group permissions.

On the Membership tab, note the Staging Quota value—4 GB. What it is? When replicating, the DFS service uses intermediate hidden folders that store modified files which are need to be transferred to replication partners. These files are stored in a local folder DfsrPrivateStaging on each server.

windows server dfs replication

On the Membership tab, open the properties of any folder and go to the Staging tab. As you can see, here you specify the path to the Staging folder and its maximum size (Quota). The default is 4 GB. In large infrastructures, it is desirable to increase the quota size to increase the performance of the DFS file replication service.

Microsoft recommends this quota should be not less than the total size of the 32 largest files in the replication directory. The total size of the 32 largest files in the directory can be obtained using the following PowerShell command:

Get-ChildItem C:SharedDOCS -recurse –force | Sort-Object length -descending | select-object -first 32 | measure-object -property length -sum).sum /1gb

If the staging quota for the DFS server is insufficient, events with EventID 4208 will often be recorded in the event log. In this case, it is recommended to increase the staging quota size by 20%.

Tip. Some admins believe that a file that is larger than the quota on the Staging folder cannot be replicated via DFS. This is not true. Such file can also be replicated normally, but the replication process will take place in several stages (the file will be cut into several parts and transferred in parts), which will somewhat slow down the process.

dfs-r

On the Advanced tab, you can specify whether to save the files deleted by users in the ConflictandDeleted folder (it is very convenient to restore) and the quota for this folder (by default, it is also 4 GB).

dfs replication service

To switch the DFS directory on a specific server to read-only mode, click the directory and select Make read-only. As a result, users won’t be able to edit or create files in this directory.

dfs replication setup

On the Connection tab, you can temporarily suspend replication to one of the servers in the DFS replication group (Disable), or start forced replication (Replication Now).

dfsr server 2016

On the Replication Folders tab open the properties of any folder. The File filter field contains a list of file extensions that are not replicated between DFS servers. The default file extensions are .bak, and .tmp. You can add other types of file extensions that don’t need to be replicated, for example, video (*.avi, *.mpeg), audio (*.mp3, *.wav), image files (*.iso, *.wim), or other file types.

dfs namespace replication

You can control the bandwidth throttling for DFS replication between remote sites. This is useful when offices are connected by slow WAN links and you don’t want them to be completely loaded by the DFS replication traffic.

For example, the bandwidth of a WAN channel between two sites is 10 MB. You want to limit DFS to 6 megabits during business hours and to unlimited for the rest of the time.

Click on the Connections tab > right click on the replication connection and select Properties > go to the Schedule tab > Select the “Custom Connection Schedule…” > Edit Schedule > Details.

setting up dfs replication server 2016

Here you can set a limit on the maximum channel usage by DFS replication traffic for different days of the week and daytime:

  • Monday – Friday from 8:00 AM to 5:00 PM — 6 Mb;
  • Sunday, Saturday, and Mo-Fri night — Full bandwidth.

dfsr replication

To diagnose DFS replication, you can use system event logs, as well as the current (%windir%debugDFSR*.log) and archive DFSR replication log (%windir%debugDFSR*.log.gz).

Information about DFS replication settings on the server can be obtained using the PowerShell cmdlet Get-DFSRConnection.

dfs windows 2016

Common DFS Replication Errors

Let’s consider the most common DFS replication errors and their solutions.

DFS Does Not Replicate Some Files

If you found that DFS Replication is not copying some files, check if they have the Temporary attribute set (0x120).

You can find such files and remove the 0x120 attribute using the following PowerShell script:

Get-ChildItem C:DFSDOCS -recurse | ForEach-Object -process {if (($_.attributes -band 0x100) -eq 0x100) {$_.attributes = ($_.attributes -band 0xFEFF)}}

DFS Replication Error 4012

If an error code 4012 appears when you trying to start DFS replication, this means that the replication has not been performed for too long.

The DFS Replication service stopped replication on the folder with the following local path: C:path. This server has been disconnected from other partners for 70 days, which is longer than the time allowed by the MaxOfflineTimeInDays parameter (60). DFS Replication considers the data in this folder to be stale, and this server will not replicate the folder until this error is corrected.

You can increase this period from 60 days (default) to 120 using PowerShell:

  1. Check the current value of MaxOfflineTimeInDays:
    Get-WmiObject -Namespace rootmicrosoftdfs -Class DfsMachineConfig | fl MaxOfflineTimeInDays
  2. Increase it up to 120 days:
    Set-WmiInstance -Namespace rootmicrosoftdfs -Class DfsMachineConfig -Arguments @{MaxOfflineTimeInDays=120}
  3. Restart DFS Services.

DFS Replication Error 2104

If replication fails, with the event ID 2104 error:

The DFS Replication service failed to recover from an internal database error on volume D:. Replication has been stopped for all replicated folders on this volume.

In this case, you need to fix the broken DFS database. Follow these steps:

  1. Disable group replication (DFS Management > Replication > Replication group > Connections);
  2. Create and run the following .bat script with administrator permissions:
    set DFS_DRIVE=E:
    
    net stop dfsr
    
    %DFS_DRIVE%
    
    icacls "%DFS_DRIVE%System Volume Information" /grant "Domain Admins":F
    
    cd "%DFS_DRIVE%System Volume Information"
    
    move DFSR %DFS_DRIVE%DFSR_backup
    
    cd ..
    
    icacls "%DFS_DRIVE%System Volume Information" /remove:g "Domain Admins"
    
    net start dfsr
    
    dfsrdiag PollAD /Member:%userdomain%%computername%
  • About
  • Latest Posts

I enjoy technology and developing websites. Since 2012 I’m running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.


DFSR is a role service of Windows Server that enables to replicate folders between multiple file servers across limited bandwidth network connections.

DFSR (Distributed File System) Replication it’s a good solution to keep sync file servers when you have branches and must be share the same File Servers across the organization.

Another use of DFS-R is as Disaster Recovery Solution for the File Servers.

In the past i have publish the article Install and Configure DFS Replication in Windows Server 2012 

Today i would like to explain how can setup DFS replication in Windows Server 2016.

Improvements in win2016

Base on Microsoft Technet DFSR in Windows Server 2016 hasn’t any improvement 

DFSR Requirements before installation

Before start the installation of DFSR it’s very important to meet the requirements in your environment

  • Update the Active Directory Domain Services (AD DS) schema to include Windows Server 2003 R2 or later schema additions. You cannot use read-only replicated folders with the Windows Server 2003 R2 or older schema additions.
  • Ensure that all servers in a replication group are located in the same forest. You cannot enable replication across servers in different forests.
  • Install DFS Replication on all servers that will act as members of a replication group.
  • Contact your antivirus software vendor to check that your antivirus software is compatible with DFS Replication.
  • Locate any folders that you want to replicate on volumes formatted with the NTFS file system. DFS Replication does not support the Resilient File System (ReFS) or the FAT file system. DFS Replication also does not support replicating content stored on Cluster Shared Volumes.

How to Setup DFS Replication

After verify that meet all the requirements we can start to setup DFS Replication in Windows Server 2016

  • Open Server Manager
  • Click Manage — — > Add Roles & Features

  • Click Next

  • Leave the Role-base or Feature-based installation and click Next.

  • Leave the default options and click Next.

  • Expand File Storage Services — — > File & iSCSI Services and check DFS Replication.

  • Click Add Features to return in first screen and click Next.

  • Click Next.

  • Click Install and wait to finish the Installation.

How to Setup DFS Replication Group

Now we can start to configure DFS Replication across the File Servers.

  • From Server Manager click Tools — DFS Management

  • Right Click in Replication and select New Replication Group.
  • In this scenario we have 2 File Servers so we must select Replication group for data collection.

  • Type a name for the Replication Group and the Domain name of your environment.

  • Select the source FileServer which contain that data that you want to replicate.

  • Click Add and select the folder that you must replicate.

  • After add the folder it will seems like this

  • Select the destination File Server.

  • Select the target folder. Don’t create the root folder in the destination because if select the target folder User as in example will be create the Path E:UsersUsers. We don’t want this. Just select the previous level before and the replication will be create the Folder. Click Next.

  • Configure the Bandwidth and when you would like to Replicate. These settings depends on your requirements. In case that you want to use DFSR for Disaster Recovery it’s better to schedule the Replication after hours instead to replicate continuously.
  • Select what is best for you and click Next.

  • Click Create 

  • Check the Status all completed sucessfull and click Close

How to Configure DFS Replication

If you are setup dfs replication for the first time it’s very common to come across with specific errors because of the wrong configuration or no configuration at all.

It’s very important to know what must be change after setup of the DFS-Replication Group.

The most common errors related with the Staging folder.

Staging folder used by DFS Replication as caches for new and changed files that must be ready to replicate. By default the size of the Staging folder is 4GB.

I am sure that you will ask which is the recommended size of the staging folder?

Base on Microsoft Technet the recommended minimum size of staging folder can be calculated with the following Powershell command. The <replicatedfolderpath> is the path to replicated folder.

Get-ChildItem <replicatedfolderpath> -recurse –force | Sort-Object length -descending | select-object -first 32 | measure-object -property length -sum).sum /1gb

After calculate the staging folder size 

  • From the  DFS Management Console in the Membership Tab right click and select Properties in the first folder.

  • Click in Tab Staging 
  • Change the Quota (in megabytes)
  • Click OK

  • Another one important configuration is the File Filtering
  • From the DFS Management Console select Replicated Folders Tab
  • Right click and select Properties in the Replicated Folder.

  • In the File Filter you can exclude extensions that you don’t want or it mustn’t replicate.
  • By default has these extensions. If you have these type of files that must replicate then you must remove it from there.

  • How can Force or Disable the Replication? 
  • From the  DFS Management Console select the Tab Connections.
  • Select the Server that you want to Disable or Force the Replication and with right click you can find the options.

  • In the same Tab select the Server that you want. Right click and select properties
  • Click in Tab Schedule.
  • From here you can schedule the Replication and the Bandwidth usage
  • You can click the button View Schedule to see what you have already schedule and the Bandwidth usage.

  • If you want to change click Cancel.
  • Select Custom connection schedule.
  • Click in Edit Schedule.

Now you have Setup and Configure the DFS Replication between two FileServers.

Of course we aren’t finish here. Because now we must learn to monitoring how the replication is going.

So I will come back next week to explain DFS Replication monitoringm

Have a nice weekend !!

You can send me an email at info@askme4tech.com  or do your comments in Twitter or Facebook

I invite you to follow me on Twitter or Facebook. If you have any questions, send email to me at info@askme4tech.com.

Слышал что можно средствами виндовс сделать реплицирование, т.е. точную копию файлов на двуз серверах. Например, у нас есть папка с документами бухгалтерии и нам нужно сделать ее точную копию в любой момент времени.

Обычно это настраивается средствами DFS + RFS

В инструкции описан процесс настройки распределенной файловой системы и репликации данных в домене Active Directory на серверах под управлением Windows Server.

Что это такое?

Наличие общих каталогов для доступа к определенным документам и файлам является важной проблемой в бизнес-среде. Системным администраторам необходимо найти удобное решение для обмена общими данными.

Distributed File System (DFS) (Распределенная файловая система) — это продукт Microsoft для упрощенного доступа пользователей к географически распределенным файлам. DFS позволяет создавать деревья виртуальных каталогов, объединяющих общие папки по всей сети.

Существует два типа DFS:

  1. Namespace DFS (Пространство имен DFS) — виртуальное дерево, объединяющее общие папки из всей сети. Возможно настроить несколько пространств имен DFS.
  2. Replication DFS (Репликация DFS) — создает реплицированную общую папку и отслеживает изменения в файлах.

Установка

В нашем случае установка производится на контроллер домена.

Откройте панель управления сервером Windows и найдите Add roles and features (Добавить роли и компоненты).

Server Manager

В качестве типа установки укажите Role-based or feature-based installation (Установка ролей и компонентов).

Istallation Type

Выберите ваш сервер из пула серверов.

Server Selection

В следующем окне отметьте DFS Namespaces и DFS Replication.

Server Roles

Затем установите выбранные компоненты.

Настройка пространства имен DFS

Прежде, чем перейти к добавлению пространства имен, необходимо создать хотя бы одну сетевую директорию на любом из серверов, добавленных в домен. В данном примере используется созданная на том же контроллере домена папка с общим доступом.

Для предоставления общего доступа к папке достаточно выбрать опцию Общий Доступ (Give access to) при нажатии на папку правой кнопкой мыши и выбрав доменного пользователя или группу пользователей, которым будет предоставлен доступ. В результате будет отображен путь до сетевой папки вида \MachineNameFolder.

Share a folder

Shared folder permissions

Shared folder path

Теперь можно приступить непосредственно к добавлению пространства имен DFS.

В меню Start выберите Windows Administrative Tools -> DFS Managment.

Или в поиске введите команду dfsmgmt.msc.

Для создания нового пространства имен выберите в правой части экрана New Namespace.

DFS Management

Введите имя сервера, на которым установлена роль DFS.

Name

Введите любое удобное для вас название. Нажмите кнопку Edit Settings.

Name

В открывшемся окне необходимо настроить права доступа к пространству имен для пользователей сети. Чтобы предоставить полный доступ, нажмите кнопку Customize.

Edit Settings

Выберите полный контроль с помощью галочек и нажмите Apply -> Ok.

Permissions for DFS

На следующем шаге выберите Domain-based namespace, т.к. используются доменные службы Active Directory (AD DS).

Примечание:

  • Domain-based namespace — обладает преимуществами, позволяет обеспечить доступность пространства имен с помощью нескольких серверов пространств имен, скрывает имя сервера пространства имен от пользователей, упрощает замену сервера пространства имен или перенос пространства имен на другой сервер.
  • Stand-alone namespace — позволяет создать распределенную файловую систему не используя доменные службы Active Directory (AD DS), увеличивает доступность namespace с помощью отказоустойчивого кластера.

New Namespace Wizard

Проверьте конфигурацию и нажмите Create.

Review Setting

В результате вы увидите сообщение об успешном создании пространства имен.

Confirmation

Добавление нового каталога в существующее пространство имен DFS

Чтобы создать каталог в созданном namespace, откройте DFS Management, выберите нужное пространство и справа в вертикальном меню нажмите New Folder.

DFS Management

Введите удобное имя каталога и нажмите Add, для того чтобы связать каталог DFS и созданную ранее сетевую папку на сервере-участнике домена.

New Folder

Введите имя сетевого каталога и кликнете OK.

Add

Нажмите OK для сохранения изменений.

OK

Подключиться к данному пространству с другого сервера можно набрав в проводнике следующий адрес:

\<доменное имя><имя пространства имен>

Например:

\instructions.1cloud.ruDFS

DFS

Настройка DFS-репликации на Windows Server

Чтобы настроить репликацию данных, необходимо установить роль DFS Replication на втором добавленном в домен сервере.

SharedFolderBasics

Теперь создадим на втором сервере сетевую папку, в которую будут реплицироваться данные из директории, добавленной ранее на контроллер домена.

SharedFolderPermissions

SharedFolderPath

На сервере пространства имен (в данном случае на Контроллере Домена)откройте DFS Management, выберете нужное пространство и справа в вертикальном меню кликните Add Folder Target.

Actions

Введите имя добавленного в домен сервера и созданного на предыдущем шаге сетевого каталога.OK.

OK

Откроется окно с вопросом о создании новой группы репликаций. Нажмите Yes.

Replication

Откроется настройщик Replication DFS. Проверьте имя группы репликации и каталога, который вы собираетесь реплицировать.

Group

На следующем шаге проверьте пути сетевых директорий.

Eligibility

Выберите основной узел, с которого данные будут реплицироваться в другие директории, являющиеся частью пространства имен DFS.

Primary Member

В качестве типа топологии выбираем Full mesh — чтобы изменения на одном узле, сразу же появлялись и на остальных.

Topology Selection

На последнем шаге необходимо настроить расписания реплицирования данных. В первом случае репликация производится моментально, во втором можно настроить удобное расписание.

Group Schedule

Проверьте настройки и нажмите Create.

Setting

В результате вы увидите сообщение об успешном создании группы репликаций.

Successfully

На данное системное сообщение кликните OK левой кнопкой мыши.

Delay

Откройте каталог, в который будет происходить первоначальная репликация данных и нажмите Continue. Произойдет первоначальная репликация данных.

Replica

На этом настройка распределенной файловой системы и репликации данных в ней закончена.

DFS Replication is an engine that allows you to synchronize folders on multiple server across your LAN and WAN connections. A great feature of this role is that you can schedule and throttle your synchronization as needed.

Installing DFS Replication on Windows Server 2016 step by step;

    • On the Server Manager Console click on Manage then select Add Roles and Features.
    • On the Add Roles and Features Wizard click Next up to the Server Roles Page.
    • On the Server Roles Page, expand the File and Storage Service then select DFS Replication

    clip_image001[7]

    • After selecting the DFS Replication click Ok on the additional required tools and then click Next.
    • On the Features Page, click next.
    • On the Confirmation Page, review and then click Install to initiate the installation process.
    • After role is installed open the DFS Management Console to start your Replication configuration.

    clip_image004[4]

    • To start a new Replication Group right-click on Replication, select New Replication Group and replication type.

      clip_image005[4]

    • On the New Replication Group Wizard Name and Domain page assign a name and required domain.

     clip_image006[4]

    • On the Replication Group Members page, add required servers including the source server.

    Important: remote servers will require the DFS role installed and also the Folder structure as well.

    Servers Example:

    SERVER01

    SERVER02

    SERVER03

    SERVER04

    • On the Topology Selection page, select your needed in my case will be Hub and Spoke

      clip_image009[4]

    • On the Hub Members page, select your Hub Member (s) in my case will be only one server
    • On the Hub and Spoke Connections page, review current members and click next.
    • On the replication page, select the first option and choose your bandwidth

      clip_image012[4]

    • On the Primary Member Page, select your source server then Next.
    • On the Folder to Replicate page, add the folders that will be replicated then Next.
    • On the Local Path of Global on Other Members page, select the local path for each server and then Next.
    • On the Review page, make sure everything is configured as expected then click Create to deploy your DFS replication Group.

    clip_image022[4]

    • Update the Quota if required, in my case I updated to 50GB because of my content.
    • Done ! you have installed your DFS Replication Group, now you are able to copy content to your main source global folder and it will automatically distribute to all your hub members.

description title ms.date author manager ms.author ms.topic

Learn more about: DFS Replication overview

DFS Replication overview

01/05/2022

JasonGerend

elizapo

jgerend

article

DFS Replication overview

Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 R2, Windows Server 2008

DFS Replication is a role service in Windows Server that enables you to efficiently replicate folders (including those referred to by a DFS namespace path) across multiple servers and sites. DFS Replication
is an efficient, multiple-master replication engine that you can use to keep folders synchronized between servers across limited bandwidth network connections. It replaces the File Replication Service (FRS) as the replication engine for DFS Namespaces.

[!TIP]
Consider using Azure File Sync to reduce your on-premises storage footprint. Azure File Sync can keep multiple Windows file servers in sync and each one only needs to keep a cache on-premises while the full copy of the data is in the cloud. Azure File Sync also has the additional benefit of cloud backup with integrated snapshots. For more information, see Planning for an Azure File Sync deployment.

Active Directory Domain Services (AD DS) uses DFS Replication for replicating the SYSVOL folder in domains that use the Windows Server 2008 or later domain functional level. For more information about replicating SYSVOL using DFS Replication, see Migrate the SYSVOL replication to DFS Replication.

DFS Replication uses a compression algorithm known as remote differential compression (RDC). RDC detects changes to the data in a file and enables DFS Replication to replicate only the changed file blocks instead of the entire file.

To use DFS Replication, you must create replication groups and add replicated folders to the groups. Replication groups, replicated folders, and members are illustrated in the following figure.

A replication group containing a connection between two members, each having a couple replicated folders

This figure shows that a replication group is a set of servers, known as members, which participate in the replication of one or more replicated folders. A replicated folder is a folder that stays synchronized on each member. In the figure, there are two replicated folders: Projects and Proposals. As the data changes in each replicated folder, the changes are replicated across connections between the members of the replication group. The connections between all members form the replication topology.
Creating multiple replicated folders in a single replication group simplifies the process of deploying replicated folders because the topology, schedule, and bandwidth throttling for the replication group are applied to each replicated folder. To deploy additional replicated folders, you can use Dfsradmin.exe or a follow the instructions in a wizard to define the local path and permissions for the new replicated folder.

Each replicated folder has unique settings, such as file and subfolder filters, so that you can filter out different files and subfolders for each replicated folder.

The replicated folders stored on each member can be located on different volumes in the member, and the replicated folders do not need to be shared folders or part of a namespace. However, the DFS Management snap-in makes it easy to share replicated folders and optionally publish them in an existing namespace.

You can administer DFS Replication by using DFS Management, the DfsrAdmin and Dfsrdiag commands, or scripts that call WMI.

Requirements

Before you can deploy DFS Replication, you must configure your servers as follows:

  • Update the Active Directory Domain Services (AD DS) schema to include Windows Server 2003 R2 or later schema additions. You cannot use read-only replicated folders with the Windows Server 2003 R2 or older schema additions.
  • Ensure that all servers in a replication group are located in the same forest. You cannot enable replication across servers in different forests.
  • Install DFS Replication on all servers that will act as members of a replication group.
  • Contact your antivirus software vendor to check that your antivirus software is compatible with DFS Replication.
  • Locate any folders that you want to replicate on volumes formatted with the NTFS file system. DFS Replication does not support the Resilient File System (ReFS) or the FAT file system. DFS Replication also does not support replicating content stored on Cluster Shared Volumes.

Interoperability with Azure virtual machines

Using DFS Replication on a virtual machine in Azure has been tested with Windows Server; however, there are some limitations and requirements that you must follow.

  • Using snapshots or saved states to restore a server running DFS Replication for replication of anything other than the SYSVOL folder causes DFS Replication to fail, which requires special database recovery steps. Similarly, don’t export, clone, or copy the virtual machines. For more information, see article 2517913 in the Microsoft Knowledge Base, and Safely Virtualizing DFSR.
  • When backing up data in a replicated folder housed in a virtual machine, you must use backup software from within the guest virtual machine.
  • DFS Replication requires access to physical or virtualized domain controllers – it can’t communicate directly with Azure AD.
  • DFS Replication requires a VPN connection between your on premises replication group members and any members hosted in Azure VMs. You also need to configure the on premises router (such as Forefront Threat Management Gateway) to allow the RPC Endpoint Mapper (port 135) and a randomly assigned port between 49152 and 65535 to pass over the VPN connection. You can use the Set-DfsrMachineConfiguration cmdlet or the Dfsrdiag command-line tool to specify a static port instead of the random port. For more information about how to specify a static port for DFS Replication, see Set-DfsrServiceConfiguration. For information about related ports to open for managing Windows Server, see article 832017 in the Microsoft Knowledge Base.

To learn about how to get started with Azure virtual machines, visit the Microsoft Azure web site.

Installing DFS Replication

DFS Replication is a part of the File and Storage Services role. The management tools for DFS (DFS Management, the DFS Replication module for Windows PowerShell, and command-line tools) are installed separately as part of the Remote Server Administration Tools.

Install DFS Replication by using Windows Admin Center, Server Manager, or PowerShell, as described in the next sections.

To install DFS by using Server Manager

  1. Open Server Manager, click Manage, and then click Add Roles and Features. The Add Roles and Features Wizard appears.

  2. On the Server Selection page, select the server or virtual hard disk (VHD) of an offline virtual machine on which you want to install DFS.

  3. Select the role services and features that you want to install.

    • To install the DFS Replication service, on the Server Roles page, select DFS Replication.

    • To install only the DFS Management Tools, on the Features page, expand Remote Server Administration Tools, Role Administration Tools, expand File Services Tools, and then select DFS Management Tools.

      DFS Management Tools installs the DFS Management snap-in, the DFS Replication and DFS Namespaces modules for Windows PowerShell, and command-line tools, but it does not install any DFS services on the server.

To install DFS Replication by using Windows PowerShell

Open a Windows PowerShell session with elevated user rights, and then type the following command, where <name> is the role service or feature that you want to install (see the following table for a list of relevant role service or feature names):

Install-WindowsFeature <name>
Role service or feature Name
DFS Replication FS-DFS-Replication
DFS Management Tools RSAT-DFS-Mgmt-Con

For example, to install the Distributed File System Tools portion of the Remote Server Administration Tools feature, type:

Install-WindowsFeature "RSAT-DFS-Mgmt-Con"

To install the DFS Replication, and the Distributed File System Tools portions of the Remote Server Administration Tools feature, type:

Install-WindowsFeature "FS-DFS-Replication", "RSAT-DFS-Mgmt-Con"

Additional References

  • DFS Namespaces and DFS Replication overview
  • Checklist: Deploy DFS Replication
  • Checklist: Manage DFS Replication
  • Deploying DFS Replication
  • Managing DFS Replication
  • Troubleshooting DFS Replication

В Windows Server 2016 появилась довольно интересная возможность репликации локального хранилища (дискового тома) на удаленный сервер – Storage Replica (SR). Данные одного тома автоматически синхронизируются по сети на вторичный сервер, на котором всегда будет доступна идентичная копия тома. Репликация данных в Storage Replica выполняется на уровне блоков с помощью протокола SMB v3.1.1 и не зависит от используемой файловой системы (NTFS, CSVFS, ReFS).

Репликация хранилищ в Windows Server 2016 работает в режиме Active / Passive. Это означает, что данные доступны только на сервере источнике. Возможны два режима репликации:

  • Синхронная репликация – данные пишутся одновременно на оба сервера. Перед записью данных на основной сервер он ждет подтверждения о записи данных на удаленный сервер;
  • Асинхронная репликация – данные записываются на основной сервер, и затем реплицируются на вторичный.

Storage Replica поддерживает следующие сценарии:

  1. Репликация между томами одного сервера
  2. Репликация хранилища Server-to-server
  3. Репликация хранилища в эластичном кластере (stretch cluster)
  4. Репликация хранилища между двумя разными кластерами (Cluster-to-cluster)

Содержание:

  • Требования к Storage Replica
  • Установка Storage Replica в Windows Server 2016
  • Настройка репликации томов в Windows Server 2016

Требования к Storage Replica

Для использования Storage Replica ваша инфраструктура должна соответствовать следующим требованиям:

  • Windows Server 2016/2019 в редакции Datacenter;
  • Оба сервера должны состоять в домене Active Directory;
  • По два дополнительных диска на каждом сервере – на одном храняться данные, на втором – логи. Диск с логами должен быть быстрее диска с данными, в идеале SSD. Размеры диска с данными должны быть одинаковыми;
  • Таблица разделов дисков – только GPT (MBR не поддерживается);
  • Поддерживаются локальные диски (SAS/SCSI/SATA), iSCSI, SAN, общие VHDX, Storage Spaces с SAS JBOD;
  • Минимум 2 Гб памяти на сервере;
  • Сеть между серверами >= 1 Гбит/с с задержками не более 5 мс в обе стороны ( как правило это ограничивает расстоянием между партнерами по репликации до 30-50 км). Сетевой адаптер желательно с поддержкой RDMA;
  • Наличие открытых TCP портов 445, 5985 и 5445 между серверами;

Установка Storage Replica в Windows Server 2016

Компонент Storage Replica можно установить из консоли Server Manager или с помощью PowerShell:

Установка Storage Replica в Windows Server 2016

Install-WindowsFeature Storage-Replica –IncludeManagementTools -Restart

Install-WindowsFeature Storage-Replica –IncludeManagementTools

Компонент Storage-Replica нужно установить на оба сервера. После установки компонента сервера нужно перезагрузить.

Настройка репликации томов в Windows Server 2016

У Storage Replication нет встроенной графической консоли управления. Для настройки репликации хранилищ нужно использовать PowerShell, Admin Center или консоль Failover Clustering (при использовании кластера).

Список доступных командлетов в модуле StorageReplica можно вывести так:

Get-Command -Module storagereplica

С помощью команды
Test-SRTopology
вы можете проверить соответствует ли ваш сервер и канал связи технологии Storage Replica. Вы можете оценить текущее количество операций ввода/вывода, пропускную способность сети, размер журналов. Командлет Test-SRTopology генерирует HTML отчет с текущими нагрузками и рекомендациями.

Test-SRTopology

Включим репликацию хранилища D: между двумя отдельными серверами SR1 и SR2 (для логов используется диск L:, размер журнала – 1 Гб):

New-SRPartnership -SourceComputerName SR1 -SourceRGName SR1ReplGroup01 -SourceVolumeName E: -SourceLogVolumeName L: -DestinationComputerName SR2 -DestinationRGName SR2ReplGroup01 -DestinationVolumeName D: -DestinationLogVolumeName E: -LogSizeInBytes 1GB

New-SRPartnership

После включения репликации на вторичном сервере диск с данными становится недоступен для внесения изменений (формат RAW).

вторичный диск репликации Storage Replica недоступен пользователям

Информацию о репликации тома можно получить с помощью дополнительных счетчиков производительности в PerfMon или из PowerShell:

Get-Counter -Counter “Storage Replica Statistics(*)

Storage Replica PerfMon

События репликации томов можно отслеживать в журналах Event Viewer (Applications and Services Logs -> Microsoft -> Windows -> StorageReplica) или из PowerShell:

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

Переключить режим репликации на асинхронный можно командой:

Set-SRPartnership -ReplicationMode Asynchronous

При выходе из строя основного сервера вы можете вручную изменить направление репликации данных, переведя вторичную копию в онлайн режим:

Set-SRPartnership -NewSourceComputerName SR2 -SourceRGName SR2ReplGroup01 -DestinationComputerName SR1 -DestinationRGName SR1ReplGroup01

Для получения информации о состоянии групп и направлении репликации используйте командлеты Get-SRGroup и Get-SRPartnerShip.

Можно проверить длину очереди копирования:

(Get-SRGroup).Replicas | Select-Object numofbytesremaining

Чтобы удалить репликацию:

Get-SRPartnership | Remove-SRPartnership
(только на основном сервере)

Get-SRGroup | Remove-SRGroup
(на обоих серверах)

Вы можете использовать Admin Center для настройки Storage Replication из графического

интерфейса. настройка Storage Replication из Windows Admin Center

Во многих организациях в качестве решения для катастрофоустойчивого хранения данных используется DFS репликация между ЦОД. У SR есть несколько преимуществ перед DFS репликацией: данные копируются на блочном уровне (возможно репликация открытых и используемых файлов, VSS снапшотов), независимость от базы данных (нет необходимости согласования базы данных при старте), быстрая и синхронная репликация (не нужно ждать часы или дни как в DFS). Из недостатков Storage Replica: репликация только 1 к 1, высокие требования к сети и задержкам, без использования кластера используется ручное переключение направления репликации и перенастройка приложений (пользователей) на новый сервер (можно упростить за счет общего DFS namespace).

В Windows Server 2019 Build 17650 Storage Replica доступна и редакции Standard (можно реплицирвать только 1 том до 2 Тб, одному партнеру по репликации. В Datacenter партеров по репликации можен быть несколько). Кроме того, появился режим Test Failover. В этом режиме на партнере создается достпный для записи том-реплика, а репликация прекращается до момента отключения Test Failover (все изменения за время использования этого режима откатываются к снапшоту).

Понравилась статья? Поделить с друзьями:
  • Настройка dfs windows server 2012 r2
  • Настройка default user в windows 10
  • Настройка default switch hyper v windows 10
  • Настройка dcom для opc windows 10
  • Настройка dcom windows server 2012 r2