One fileserver and two replicated nodes with samba daemon

0

I have to set up a new infrastructure for a project. We have two offices with a slow up- and downlink (2 MBit SDSL) to the internet and one server C with a 100 MBit link to the internet. Then there is a Ubuntu machine in each office (A and B) with a samba share so that each user in the particular office can mount that share under a drive letter on Windows. This way they have a fast access because the internal LAN uses 100/1000 MBit. Next the two Ubuntu machines (A and B) and the Ubuntu Server (C) should replicate the data between them. They all have a 1 TB drive and the data on them should always be exactly the same.

For that reason I tried GlusterFS on Server A and C but is seems not to be very reliable (server B does not exists for now). For a quick test I copied a 10 MB file to the glusterfs mountpoint on Server A. In the same second the file appeared on server C but was only 6 MB. It takes up to 30 minutes until the file on server C got its correct size of 10 MB. Because of that I do not really want to use it in a productive environment.

The main problem is that the users in the office want to have a fast connection to the local server and if someone changes, deletes, moves or creates a file it should also be changed, deleted, moved or created on the other servers. Maybe it would be enough to only use the servers A and B as a cache but what is the best service for this?

I really appreciate your help. It would be nice to find a suitable solution. Thank you!

Nicolas

Posted 2015-06-29T10:29:13.783

Reputation: 69

Answers

0

The standard solution to this problem is to utilize a program called Unison. Their Web page states:

Unison is a file-synchronization tool for OSX, Unix, and Windows. It allows two replicas of a collection of files and directories to be stored on different hosts (or different disks on the same host), modified separately, and then brought up to date by propagating the changes in each replica to the other.

The integration with a Samba Share is easy enough: it is discussed in detail on the Samba Wiki pages.

Basically, it consists of four steps:

  1. User synchronization. It is most convenient to have the same set of users of both systems. This is especially easy if the shares belong to the same user, and anyone can modify their content. But you can also setup your system to have all of the users of both LANs, it just depends on you.

  2. Passwordless access. This is necessary to allow automatic, yet secure ssh connections between the two systems.

  3. Unison setup (easiest part, just a one-liner).

  4. crontab setup. This is necessary to synchronize your two machines every minute (cannot be done more often via crontab). This is a one-liner too.

This is basically all.

MariusMatutiae

Posted 2015-06-29T10:29:13.783

Reputation: 41 321

Unison is no more under active development. I don't want to use it in that state. Sorry. – Nicolas – 2015-07-04T10:52:53.217

@Nicolas: No, this is false: their Web page, http://www.cis.upenn.edu/~bcpierce/unison/status.html, states that "Unison is no longer under active development as a research project". It also states that It will continue to be maintained and supported for the foreseeable future, and we occasionally release new versions with bug fixes, improvements (sometimes large ones), and contributed patches.

– MariusMatutiae – 2015-07-04T15:41:16.300

@Nicolas Also, you shouldn't feel sorry: if you do not want to use it, it is up to you, I couldn't possibly care less. I just wish you good luck finding another solution, being currently maintained or not. – MariusMatutiae – 2015-07-04T15:43:01.510