views:

422

answers:

3

We have two web servers with load balancing. We need to share some files between those servers. These would be uploaded files, session files, various files that php applications create.

We don't want to use a heavyweight, no longer maintained or a commercial solution. We're looking for some lightweight open-source software that would work as shared file system. It should be really easy to set up, must be HA available, must be very fast. It should work with RedHat Linux.

We looked at such solutions like drbd with synchronous file sharing but we can't use them because it can't work on an underlying filesystem like ext3.

+2  A: 

DRBD is good for syncing over a network (direct crossover connection if at all possible), but EXT3 is not designed to be aware of changes that occur underneath it, at the block device level. For that reason you need a filesystem designed for such purposes such as the Global File System (GFS). To the best of my knowledge Red Hat has support for GFS.

The DRBD manual will give you an overview of how to use GFS with DRBD.

http://www.drbd.org/users-guide/ch-gfs.html

Don't take this as a final answer - I have not researched or used a multi-master system before, but at least this might give you something to go on.

Ideally, you would only sync the part of the data that's shared between the webservers.

Tim Kersten
This isn't to say it's the wrong thing, but GFS is hardly lightweight.
Charles Duffy
...also, GFS1 has lousy performance with large numbers of small files; GFS2 does that much better, but isn't supported for production usage just yet (it will be with RHEL5.3, but that isn't out right now).
Charles Duffy
+1  A: 

OCFS may be up to snuff by now; it's worth checkout out at least. It's in the mainline linux kernel tree, http://oss.oracle.com/projects/ocfs2/ has some info on it. I've set it up before, it was pretty easy to get going.

pjz
A: 

Try the Mirror File System, http://www.usenix.org/events/fast08/wips_posters/slides/wong.pdf