0

We have a website that runs on multiple web servers. Those servers need to be in synchronization - program files and user uploaded data should be present on both servers. For now this is implemented having post commit hook to synchronize code files. And script doing synchronization in one minute intervals to keep user uploaded files in synchronization. This setup has some drawbacks and seems kinda a little bit like a kludge to me. There should be a better way, maybe someone can suggest something?

1
  • What storage do you have? All local, iSCSI, some other SAN? Also, do you want two sets of storage which are synced, or would you prefer / desire one set of storage which is shared? Apr 30, 2012 at 14:23

2 Answers 2

2

Linux: drdb
Windows: DFS-R
FreeBSD: HAST
*: rsync

2
  • It seems drdb in general/only provides read-write access to main server (node in their terms) only. We however need both servers to have ability to read and write date that should be visible across them. But maybe I just haven't dug enough and there is possibility to do that?
    – morphles
    Apr 30, 2012 at 13:56
  • You are correct, in that case I'd recommend rsync or if you want to centralize the storage nfs, as the other answer points out.
    – Chris S
    Apr 30, 2012 at 15:10
2

Syncing is quite tricky by nature. Instead, you could also make the servers access a shared storage. Turn one of the webservers (or another server) into an NFS server, and have the other servers mount the shared storage.

NFS is quite efficient and has locking to prevent conflicts. On a local network you'll have good performance, unless you have a large number of webservers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .