1821983 Members
3316 Online
109638 Solutions
New Discussion юеВ

two way file replication

 
SOLVED
Go to solution
selcuk_1
Advisor

two way file replication

Hi admins..

I have two HP-UX boxes(B.11.11 ). They are being used as application servers.

Our applications write some files (images/jpegs) on the local servers (not database).. But users can login any application servers and can request the file! So I need to replicate new files between application servers..

How can I do this.. ?

AFAIK, rsnyc tool can replicate as master / slave mode.. So I can not do 2 way replication..

If I use NFS and put all files to a single app server, then if that application server crashes I will lose my functionality (for disaster recovery) and files !


TIA..





search for the meaning
8 REPLIES 8
Peter Godron
Honored Contributor
Solution

Re: two way file replication

Hi,
nfs export local filesystem to serverB.
Sync to second disk on serverB.
If serverA dies, no problem
If serverB dies, you have the data on second disk.

Alternate: use shared SAN /dual path array
RAC_1
Honored Contributor

Re: two way file replication

sync is mot master/slave type tool. It basically keeps in a sync fiels at multiple locations. This would fit your bill.
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor

Re: two way file replication

I'm concerned with your approach in that it is quite possible to have different versions of the same file depending upon when the systems are sync'ed. My approach would be NFS but deployed as an MC/Service Guard package so that if the currently active node fails; NFS shifts over to the other node. That is going to be more robust than your current approach and not prone to data being out of sync.
If it ain't broke, I can fix that.
Shahul
Esteemed Contributor

Re: two way file replication

Hi,

Here are two options, you can chose which ever suite to you.

Option 1.

Install rsync on both the systems. Run rsync from Server1 to Server2 with out -delete option. This will copy all the data from server1 to server2, but will not delete anything from server 2. Then

run rsync from Server2 to Server1. This will again copy additional data from Server2 to Server1, remember you should not use -delete option.

Option 2.

Use NFS, Mount Server1 filesystem in Server2 and create files in single location. For high availability, you may need to go for MC/Service guard, or Array level sharing, etc.

Hope this helps.

Best of luck
Shahul
selcuk_1
Advisor

Re: two way file replication

I will use NFS.. Because it is possible to get different versions of the same file.. For example, 2 users can work on the same file before replication..So I will avoid this using NFS..

I will save copy of files every night to other machines different directory..

In case of a failure in machine which exports files, I will change the other machine's directory's name to NFS chare directory and continue to work..!

Do you see any problem here ?
search for the meaning
Prashant Zanwar_4
Respected Contributor

Re: two way file replication

NAS can be a good deal too ! which off course uses NFS... You can use it among whatever number of servers.. and moreof if file changing location reamins one, and users on apps host not changing files, you can keep read only on application host..
Consider at the same time NFS weaknesses..

Best luck
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
A. Clay Stephenson
Acclaimed Contributor

Re: two way file replication

Your NFS approach will work but far better would be NFS under MC/Service Guard. The idea is that the data are stored on an array (or disks) physically attached to multiple servers and should the active host fails, another host assumes the IP address of the NFS server. The clients do not connect to the host's IP address but rather the IP address associated with the NFS package. Often, a server could fail and the clients wouldn't even know that it had happened.
If it ain't broke, I can fix that.
PeterWolfe
Respected Contributor

Re: two way file replication

Can't do this under 11.11,
but in the future if/when you upgrade,
another possible approach would be
Serviceguard but with the Cluster
File System (CFS) instead of NFS.

If two instances of your application
are able to read/write to the NFS mounted
directory then that implies it is
already doing all the proper locking
operations.

You would likely be able to substitute CFS
here and still have HA and none
of the NFS management headaches.
Until then, NFS under Serviceguard is
just the ticket.