Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-08-2010, 04:03 PM   #1
LQ Newbie
Registered: Mar 2007
Location: Seattle
Distribution: CentOS, Fedora, Ubuntu
Posts: 17

Rep: Reputation: 0
Simple mirroring networked file system?

Hi all.

I have two web servers. One is active and one is in reserve. I keep the user data (web pages) in sync by running rsync every 10 minutes or so. This copies any changes from the active machine to the reserve machine. But, it's slow, only gets changes every 10 minutes, bogs down the disk, does strange things to files that are changing during the rsync process etc...

I want something that will automatically copy any changes from the active server to the reserve server as they are made. IE I hit 'save' on the active server, it copies the file to the reserve server. Simple!

I've been looking around and I see GFS which is really vastly more complicated than I need. I'm happy with read-only access on the reserve host, so I don't need distributed lock management.

I could theoretically implement this by setting inotify watchers on every file and running an SCP or rsync command when a file gets saved. So, it can't be that hard.

I do not need a true networked file system, as in something I mount over the network. I just want something to keep my disks in sync.

Either other people have had this problem and there's a solution or I'm thinking about this the wrong way and there's a solution.

Old 04-08-2010, 04:11 PM   #2
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Perhaps DRBD would do the job
Old 04-14-2010, 06:39 PM   #3
LQ Newbie
Registered: Mar 2007
Location: Seattle
Distribution: CentOS, Fedora, Ubuntu
Posts: 17

Original Poster
Rep: Reputation: 0
I tried DRBD, but you can't read the contents on the inactive server. I need to be able to check the inactive server to make sure it's working and if I can't see the user data that I want to mirror, I can't test it. DRBD can do a thing called 'dual primary' where you can actually mount it on both machines, but it's the filesystem, not the block device, that tells the kernel when a file has changed, so changes on the active host don't appear on the inactive host and things can get very weird. If I wanted to run GFS, I could make it work, but that just seems like a crazy idea when I don't need both ends of the connection to be writable.
Old 04-14-2010, 09:44 PM   #4
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,395

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Actually, inotify can watch whole dirs, so shouldn't be much work. See example 1


filesystem, mirror, network

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unioning and mirroring file system over the internet cantab Linux - Server 2 04-06-2010 05:07 PM
Creating a simple file system module Raynus Linux - Kernel 2 10-07-2008 06:39 PM
simple unix file system problem alokatzenith Programming 16 11-01-2007 06:02 PM
writing a simple file system in linux Deepthi_57 Linux - Newbie 1 05-03-2004 12:42 AM
how to implement a simple file system for linux amitchakote Linux - Newbie 8 03-17-2004 10:19 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration