Настройка dfs в linux

Обновлено: 03.07.2024

FRS (File Replication Service) is used to replicate SYSVOL in Windows Server 2000 and 2003. It is slowly being replaced by Microsoft with DFS-R (Distributed File System Replication) in newer versions of Windows Server.

Samba does not yet include SYSVOL replication, neither with FRS, nor with DFS-R.

DFS-R is often viewed as subfunction of DFS (see below), and both are often used together, but they can also be used completely separately: DFS with multiple targets can be used without DFS-R (if the folder contents are updated with some other method), and DFS-R can replicate shared folders that are not DFS-targets.

Samba partially supports DFS, but not DFS-R yet.

Some users have reported success using Syncthing to emulate DFSR.

What is DFS

DFS (Distributed File System) is a feature that provides several functions: alternative name space, load balancing, and automatic failover.

Technically DFS provides access to a shared directory that contains no files, only junctions, and optionally subdirectories with more junctions. Junctions are similar to soft links as known from Unix file systems, but ones that point to shared directories, and they can also point to shared directories on other servers. The clients first ask the DFS server for the junction, then access the file server where this junction points to.

The main use of this is to create an alternative name space (directory tree view), that hides details of the underlying infrastructure from the users. The paths that the users see (called DFS names) do not change when servers are renamed, or when some of the directories are moved to a different server. The administrators can simply replace the outdated DFS name with a new one, that points to the new target.

A DFS name can optionally point to more than one target (i.e. tell the client several alternative junctions to different shared folders). In this case clients can access either of the targets. This provides load balancing, and automatic failover to another server, if one server fails.

stand-alone versus domain-based DFS

DFS can be either stand-alone, or domain-based.

The stand-alone variant runs on one single server and causes the DFS names to contain the name of that server, they look like shares that are provided by that server.

The domain based setup causes the DFS names to contain only the name of the domain, not the name of any specific server. Several servers in the domain can act as DFS servers in parallel. Clients automatically select one of the DFS servers and send their queries to that one.

Configure stand-alone DFS in Samba

In short it requires in the config file smb.conf the global option

(which is default on AD-DCs) and in one share declaration the two options

Then in the specified path create entries by running commands like

The first example defines one target, the second example creates two alternative targets that share the same contents.

Windows clients will see these as junctions.

Configure Member server DFS in Samba

Similar to above but required one additional setting in smb.conf the global option so it would be

Other just follow what happen on above.

Configure domain-based DFS in Samba

The procedure is the same as for stand-alone DFS, but it requires the vfs_object dfs_samba4 (which is default in AD-DC, but beware of the pitfalls of the vfs object option), and the DFS names must be declared on each DC (because the endpointmapper for DFS is not implemented).

There is currently (July 2014) a discussion in the mailing list in which several users report great difficulties with domain-based DFS in samba 4, maybe related with the implementation of smb protocol version 3.

Limitations

Neither the path dfsroot specified in the DFS share, nor any of the share paths in the ln-commands must contain upper case characters. The links might be allowed to contain upper case characters.

DFS works only for Administrator in Samba 4.1.4, and requires a patch to work for all users.

There is currently an ongoing discussion in the mailing list whether or not domain-based DFS really works.

Есть севачок на центос 6.5 для него собрал самбу 4.1.5 и развернул ее в качестве контролера домена в АД.

Рулю доменом с Вин7 через штатную оснастку. На первый взгляд все замечательно. Компы в домен вводятся. Пользователи тоже. Но в процессе настройки выявился облом с DFS. С помощью штатной остнастки сделать доменный корень невозможно. Лезут ошибки о невозможности соеденится со службой DFS на контролере.

Есть ли способ сделать в домене самбы именно доменный корень DFS, чтобы АД о нем знало?


Скорее всего не получиться. DFS - это распространяемая файловая система, т.е отдельный сервис от Microsoft.

И, как я понял, вписать напрямую в конфу AD не получиться, к сожалению.

По ходу вы не в курсе, что такое DFS.

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

А умеет ли вообще Самба доменный DFS?
Если бы умела, то как минимум в конфиге самбы должна была бы быть опция, указывающая, является ли корень DFS доменным или standalone. А такой опции я что-то не вижу.

Вообще, в крупных инфраструктурах обычно разносят AD и DFS Root по разным серверам. А в мелких - нафига вообще DFS?

А умеет ли вообще Самба доменный DFS?

Ну я этото вопрос собственно и задавал. Вы у меня в свою очередь спрашиваете?

Даж не не знаю что ответить. DFS нафига потому-что удобно. Монтируется всем при входе один диск. В него сведены все файловые ресурсы конторы. И не надо никому лазить по сети. Все четко и прозрачно.

Но если вы под мелкой конторой подразумеваете 2-3 компьютера, то да. ДФС там не нужен. Как впрочем и АД.


знаю я что это. и настроено у меня.

Т.е. оформляете корень, к папке куда корень ссылается монтируете что надо.

Если же вам нужна еще репликация, именно репликация, то тут самба не поможет, ибо нет этого механизма там. Но репликацию можно сделать тем же rsync, но могут быть коллизии. если конечно не назначить мастера репликации (как в DFS виндовом).

собственно и вопрос автору, зачем Вам DFS? просто красиво чтобы шара была вида \\domain\share или репликация?

Ваши ссылки это расказ об обычном серверном корне DFS. Как его сделать известно много лет и все нормально и успешно работает на куче стандалон-серверов. Но речь шла о доменном корне.

А умеет ли вообще Самба доменный DFS?

Ну я этото вопрос собственно и задавал. Вы у меня в свою очередь спрашиваете?

Это я как бы намекаю, что нужно посмотреть документацию и понять, умеет ли Самба доменный DFS. По всем признакам - не умеет, иначе в конфиге самбы была бы опция domain|standalone, задающая, где хранить DFS-линки для данного корня DFS: в AD или локально. А раз такой опции нет - то, скорее всего, не умеет.

Еще вариант - поднять AD на самбе, а доменный корень DFS - на винде. Тем более что для больших организаций рекомендуется вешать AD и DFS на разные серверы. Но думается, что если бы в наличии был нормальный виндовый сервер, ты бы не мучил самбу в качестве AD =)

Ну естественно, траханье с самбой имеет цель понять границы применимости самбы4 как дц.

Уже вылезло столько косяков, что есть мнение о профнеприходности самбы4 как дц. Кстати не только как дц, но и как мембера домена. Центос с самбой4 не могу ввести в домен нормально. Точнее в доменн вводится, wbinfo людишек-группы видит. А вот getent - ..й со всеми вытекающими.

Со штатной для центоса самбой 3.6 - все нормально.


Ну естественно, траханье с самбой имеет цель понять границы применимости самбы4 как дц.

мой те совет - ставь win2003 и поднимай домен. ИМХО, самба пока сырая.

Сам посмотри сколько времени ты уже потратил на самбу. Винду поставил и все!

Каждый инструмент для своих целей. Для домена Windows!

Еще такая вещь. Каждый KB установленный на клиентской машине грозит проблемами с работой клинета с ДС под самбой. (а логи в самбе очень информативные). M$ хоть и говорит, что они открыли полностью протокол домена Win2003, но слабо верится.

не сцы русские не сдаются

все нормально. Практически все вопросы улеглись. Для 30-50 клиентов нормально.

Где я сейчас найду вин2003? Уже 2008 не купить. А зачем ты обновления все разрешаешь? Я удивляюсь таким админам. Домен и поднимается чтобы эффективно зажать пользователей. Если они под прессом очень мала вероятность деструктивных действий. Следовательно есть время подумать какие обновления ставить или вообще ограничиться только СП.


Где я сейчас найду вин2003? Уже 2008 не купить.

I wanted to access a full DFS tree of shared folders from my Windows Server 2008R2 network from an Ubuntu Linux 12.04 machine running on the same network.

My first attempt at using “sudo mount –t cifs …blah-blah-blah… “ simply would not work. Sometimes it *seemed* to connect, but the folders were always empty. I wasted hours trying to figure out how to solve this.

These are the steps that finally made it work:

1. Enable/configure proper WINS resolution

Basically, it boils down to making this change:

image

2. Install SMBFS and KeyUtils

So, some posts lead me to install these things:

Some posts state that the Samba stuff on Ubuntu is now deprecated or replaced by the newer CIFS stuff, and for some things, CIFS is the only thing needed, but I assure you that the original Samba package is also required to connect to a DFS tree on a Windows server.

You will notice that “smbfs” will also install “cifs-utils” if it’s not already installed.

3. Configure smb.conf

I also made a few tweaks in /etc/samba/smb.conf. Uncomment these lines, and enter the correct values for your network:

image

4. Finally – a very important discovery…

This is the magic that finally made this work for me. Changing one little parameter…

I happened to notice this teensy little difference in one of my files compared to a blog post referenced in the only reply to my original question on SeverFault.

In the /etc/request-key.conf, I changed this line:

Note: This file is created by the “keyutils” install. It was not present before, as I looked for it. I noticed that it appeared after installing keyutils via apt-get.

Two things to note here…

2. Warning: The suggested –t option has something to do with “trusting” the DNS server to resolve and retrieve kerberos session keys. I really don’t understand what it all means, but it is explained in the link listed right above here. All I know is, from my trial-and-error testing, this allows Windows DFS tree mounting to work, and it DOES NOT work without –t on this one line.

So, read the above link to learn more about this and make sure it’s safe for your environment. I tried several times to make it work without the –t option, but whenever it connected It gave me folder names from the DFS tree, but they were empty when viewed in Nautilus.

You need to restart your terminal window after making these changes and before going to the final step below:

Читайте также: