Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

We're trying to find a system to keep a pair of servers in sync, and I've looked at a million solutions. I came across incron, which seems like it would be perfect. Now, I just need a low overhead way of copying the files that have changed to the other server. It's a local network, so encryption isn't necessary, and it's a gigabit connection, so compression is out as well.

Rsync might work, but it seems a little hefty for this task. nc seems like it would be great, but I don't know of a way to signify to the other server where the file should go from the first server.

Suggestions?

share|improve this question
2  
rsync is your friend. It copies only files that have changed. Don't be scared by the many command line switches, you can probably do with only a few of them. -a combines a lot of useful switches, check the man page for more details –  jippie Jun 2 '12 at 17:02
    
I've used rsync for years, but again, it just seems like it's too heavy for this situation. I need "real-time" synch, an actual cron job running rsync won't work for me. –  Glen Solsberry Jun 2 '12 at 17:07
2  
I think you should elaborate on what type of data you are trying to sync, what 'real time' is in your case and why you think it is necessary. –  jippie Jun 2 '12 at 17:11
2  
That is a remarkable requirement; your users expecting you to sync files between two metal boxes that they've never seen and probably aren't even aware of. Why is it important that the files get synchronized between two servers? What is the functionality you're trying to accomplish? My best guess so far is you should implement an NFS share and forget syncing. –  jippie Jun 2 '12 at 19:27
2  
General solution is to do this either in your application itself e.g. copy the data to different servers via a queuing system or use a storage solution which supports your specific needs. –  Ulrich Dangel Jun 2 '12 at 23:52
show 2 more comments

1 Answer 1

If you want replication within seconds, what you're looking for is not a method to synchronize two filesystems on different machines, but a cluster filesystem that supports replication.

For your use case, ChironFS looks appropriate. It is a distributed filesystem that focuses on replication. It lives on top of a “real” distributed filesystem (i.e. it doesn't have its own network protocol), so make your upload servers mount each others' drives over NFS, and direct all writes through the ChironFS layer so that they'll be replicated; read locally for speed.

share|improve this answer
add comment

Your Answer

 
discard

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.