Realtime Replication of a Single File

Matt Roth mroth at imminc.com
Sat Dec 10 01:22:47 UTC 2005


Jason,

Thanks for the brilliant suggestion.  With a little research I whipped 
up a Perl script for the read end of the pipe.  It writes the data 
locally, then sends it down a socket to another script on the remote 
machine for replication.  I played around with rsh and ssh, but they 
were lagging pretty badly (5-10 seconds to return) on a regular basis 
(roughly 1 out of every 20 instances).  Not only is the socket really 
fast and reliable, it also prevents the need to spawn another process 
per write.  Time will tell, but I believe this is the right solution.

I appreciate everyone else's suggestions as well.

 > MR> Please provide me with tips on how to replicate a single file to a
 > MR> separate machine as changes are made to it.
 >
 > If your application truly only supports logging to a file, then
 > consider seeing if it will continue to log when you replace that file
 > with a named pipe.  Connect the read end of that pipe to a program
 > that does whatever you want; you could even connect it to an instance
 > of ssh or nc to a remote machine.
 >
 > - J<

Sincerely,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer




More information about the fedora-list mailing list