Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm architecting a new server structure and I plan to have two apache workhorses and a sql database behind both of them. I was wondering what the best way to mirror the data between the apache servers is. User data should be limited on these servers as most of it will be in the could with S3.

From the prelimiary research I've done so far I've read about GlusterFS and DRBD, but would a simple rsync script do the trick?

share|improve this question
up vote 5 down vote accepted

Honestly I wouldn't suggest doing live-time replication between the apache machines. Have them have their own code, or rsync from the "main" server every so often. live-time (or near) is a lot of file inspection that just isn't necessary 99% of the time.

Personally i would recommend having three layers.

Load Balancing / Web Servers (your http/php processes)

File Servers (code/files that are needing to be shared across all web nodes)

Database Servers (your backend databases)

A lot simpler then having to do full replication between servers.

If you dont have the ability to have a dedicated file server (NFS/ect), Have "Web2" Mount "Web1's User Uploads", Both webservers will be able to read & write to the shared area, no syncing ect required unless your updating website code.


/var/www/website/_files (NFS mouned to Web1)
/var/www/website/_files.bak (rsync copy from web1 incase web1 explodes)

Both servers are near-livetime in terms of storage, they're redundant, and you dont have to add in any complex syncing nonsense.


there's a guide on how to use NFS on an EC2 instance.

share|improve this answer
+1 : GlusterFS and DRBD require alot of work, which may not be worth it for a two servers. – Stefan Lasiewski Aug 5 '11 at 23:02
Exactly my thinking as well, They're perfectly acceptable options at a very very large scale. – GruffTech Aug 5 '11 at 23:11
Could you explain more details between www and files? Is NFS or Web1 a single point of failure? – quanta Aug 6 '11 at 7:12
I like the idea of just rsyncing between the two servers as the coding will often not change. The reason that I brought up GlusterFS and DRBD is for scalability in the future. But as quanta points out, isn't the NFS server a single point of failure? I can't afford another two servers to make a NFS cluster. But going back, my main reservation with rsync is what happens if I load balance and a user is directed to "newer" server and on the next refresh is sent to the "older" server? – bswinnerton Aug 6 '11 at 23:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.