1830938 Members
1732 Online
110017 Solutions
New Discussion

Re: File Syncronization

 
SOLVED
Go to solution
Alan Garner
Frequent Advisor

File Syncronization

I have a need to syncronized file between multiple servers. This seamed like a snap with rsync however, its limits prevent us from using it!

I need a solution that will ensure that indivudal files I specify will remain IDENTICAL across multiple servers. During my rsync testing, I could get files copied in both directions no problem...but they seemed to overwrite each other.

Our servers will be load balanced from the network side so changes could potentailly be made on both servers at any given time!

I only see two other solutions: NFS & SAN (maybe).

I'm not thrilled about the prospect of NFS due to the fact that, based on what I know, it presents a single point of failure...the NFS server itself!

The SAN solution seems like a viable option as we do have an EVA, however these particular servers were not slated to be attached and would require the purchase of additional hardware! My knowledge of SANs is limited so I am not 100% sure that multiple servers could even use the same LUNs.

Hence my posting here! ;)

Your 2¢?
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: File Syncronization

Shalom,

Either of your solutions will work but they take time and planning.

rsync in an ssh tunnel can do the job.

Example:
rsync -avH --stats --delete -e ssh /var/mysql/ $othernode:/var/mysql/


This can be modified slightly to use only newer files and run both directions in a two node setup.

Best long term to put the files on a SAN or NFS.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: File Syncronization

The problem with an approach using rsync or rdist or some kind of copy scheme is latency. By definition, there will be some times when the same files (at least with respect to filenames) are different in content. The only way to really avoid that is to have one and only one set of files so that there is nothing to copy. Simply going to a SAN isn't going to fix you because you now have the problem of multiple hosts accessing the same devices. You cannot normally allow multiple hosts to read-write mount the same filesystem. The fundamental problem is buffer-cache consistancy. HostA won't have a clue about HostB's buffer cache and chaos is guaranteed. There is something called the Cluster File System that appears to be a local vxfs filesystem to multiple hosts and will do just what you want. The least expensive option to do what you want is NFS --- and it will work quite well. Of course, any scheme will also take into account file locking so that two hosts don't alter the same file --- or you might implement locking down at the record level so that while multiple hosts can access the same file, they are not allowed to modify the same parts of the same file at the same time.

While you are concerned that NFS is a single point of failure, those concerns can be addressed via ServiceGuard which also applies to CFS as well.
If it ain't broke, I can fix that.
Alan Garner
Frequent Advisor

Re: File Syncronization

Again, rsync does not work for us.

using the command:
node1# rsync -avH --stats --delete -e ssh node2:rsync.test .

The contents of the file rsync.test from node2 do infact get copied over but it OVERWRITES the existing contents of rsync.test on node1. This will not work for us! Even using the --append or -u (update) optins did not peroduce the results we needed!

AS for the NFS, do you not think that the NFS being a single point of failure would present a problem in the event of a failure! The files that we need replicated are part of an enterprise application that is tied to ~90% of our business!

With the SAN option...are there any problems with multiple servers accessing the same LUN.
A. Clay Stephenson
Acclaimed Contributor

Re: File Syncronization

As best as I can tell, I have answered your questions. You need to look at CFS or you need to look at NFS under ServiceGuard. With ServiceGuard, your current NFS server might fail but your NFS service is transferred automatically to another host --- along with the IP address associated with the NFS service.
If it ain't broke, I can fix that.
Alan Garner
Frequent Advisor

Re: File Syncronization

Yes, you did answer the question. I posted in response to Mr Protter's reply and before I read your answer. My appologies!

Thank you for your expertise! I am glad to see we will need to go the supported way as I was not looking forward to "patching" something together!

I will assign points!