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

Say you have four VPS instances running. One is an nginx proxy which handles requests for your two middle layers VPS instances running a web app via FastCGI and the final VPS is running the database.

What would be the best method to share storage between the three backend instances using only the resources available on each VPS (no access to a SAN)? I know that NFS is obviously one way of sharing data but as far as I am aware you can't combine separate storage areas from different VPS instances into one using NFS.

Is there a better way to achieve some kind of storage sharing between these nodes so that if I want to bring up another node to handle extra load I don't need to have some fancy method in place to keep all (non-database) app data in sync. This needs to be accessible using a standard POSIX file system interface so that the running apps do not need to be rewritten to use a new technology (otherwise I'd just use Amazon S3 or something similar).

Any help is appreciated.

share|improve this question
Is it likely that the VPSes are all running off the same physical storage device? Can you explain more about what you mean by "app data"? – sciurus Jun 29 '11 at 15:52
up vote 1 down vote accepted

You are looking for drbd. This is a filesystem replication.

We hat some splitbrains with master/slave in the past, so we have changed the filesystem on the top from ext3 to gfs2 and operate the cluster in active/active mode now.

share|improve this answer
Thanks, that is pretty useful information. Can you give me an indication of the speed you see using that setup? Do you use dedicated servers or VPS machines? Obviously because VPS machines must share the network and storage I am concerned that the performance might not be that great when all is said and done. – Cromulent Jun 29 '11 at 1:34
@Simon: we have read and write rates about 15-30MB/s from 4 systems. That are VPS systems, but on a SAN Storage and with configured Traffic Shapers to get a constant 1Gbit connection. But if i tell you more, there will be a realistic chance my boss kills me ;) – Thomas Berger Jun 29 '11 at 1:37
DRBD is not filesystem replication. It performs mirroring at the block device level. Actively using the device on both servers requires a clustered (shared-disk) filesystem. It's a relatively complex setup. Since it can only mirror between two servers, it doesn't seem like a good answer to this question at all. – sciurus Jun 29 '11 at 15:49
@sciurus Ok, "filesystem replication" is not the correct description. What i want to tell is, that it replicates the whole filesystem, not just the data content. You are right, you need a cluster filesystem, i told about gfs2. And right, you could only replicate two nodes, but you could share the storage via nfs for the other systems. There is simply no way to do exactly @Simon was asking for, without a real shared storage like SAN/iSCSI, so i gave the closest answer i could. – Thomas Berger Jun 29 '11 at 16:41

The simplest approach is probably to start another VPS that stores all the "app data" and exports it via NFS to the application servers.

share|improve this answer

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.