2

I have a clustered Ubuntu server layout. Is there a way to configure filesystem synchronization only when a change is made/file is modified (to save resources)?

Trent Scott
  • 959
  • 1
  • 12
  • 28

2 Answers2

2

Personally I'd look to see if there's a way to work on the servers to use something like glusterfs or DRBD, a clustering filesystem, so it'll automatically sync the filesystem. This would require some kind of heartbeat and fencing system put in so that you don't end up with split brain scenarios and graceful recovery options when a server goes down, but you get those issues with data clusters.

rsync will end up with potential issues with keeping the data synced up at the right times; how will you push the data and pull data? How often? Is your solution architected in a way that you won't be overwriting data when it's been altered on A and B...how do you decide which is "authoritative?"

The other option is shared storage; a SAN of some kind that will hold the data, and your web front ends read from it. The SAN would keep all the data in RAID and keep decent backups for redundancy's sake.

Bart Silverstrim
  • 31,172
  • 9
  • 67
  • 87
1

You could use rsync, but why not make /home an NFS share? rsync only sends changed files.

As a side note, only having a single load-balancer causes you to have a single point-of-failure (SPOF). You might want to get another one in there...

gWaldo
  • 11,957
  • 8
  • 42
  • 69
  • Great idea! Just to confirm: Create another Load Balancer (Server F) and an NFS server (Server G) which is used by the web servers (Servers A/B) for data. This way, all client files are stored on the NFS server and the web servers pull that data. Think I should forget about storing files in /home on the NFS server? How would you implement this on web servers that use virtual hosts? – Trent Scott Sep 16 '11 at 23:43
  • Sort of. Yes, an additional LB ("F"), but serving NFS from a "G" again creates a SPoF, unless you Load-balance and cluster it (http://serverfault.com/questions/274990/fault-tolerant-nfs). If you 're going to stand up "G", you're also going to want "I". Unless capacity or resources are an issue, you could serve the NFS from the webservers as well (probably from a separate set of disks, though.) While more complex, the complexity is minimal, and allows for easy scalability. (Or you just use the webservers to host NFS temporarily until you can get new fileservers.) – gWaldo Sep 21 '11 at 14:30