[DRBD-user] Re: loop device and eth0 loop-back + latest version

Eugene Crosser crosser at rol.ru
Sat Apr 24 11:14:32 CEST 2004

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

This is really getting off-topic but I'll take a risk before the Gurus
put a stop to it :)

On Sat, 2004-04-24 at 06:20, Nuno Tavares wrote:

> Here is the scenario:
> I have 2 servers. I need to have /home on both servers in sync, so when a
> user logs in on any of both he gets his preferences, files, etc. If he
> logs into server1, creates a file, then logs off, then login into server2
> the file HAS to be there. 
> If possible, locking should be done on a "who
> gets it first can lock it" basis. This means that if the user logs into
> server1 and opens file for writing/update FOO.TXT, and then logs into
> server2 (without logging off server1) and it opens file, then the file may
> only be accessed READ-ONLY.
> So, Greg, here are the pre-requisites:
> Locking: Basic (the first to open it R/W, locks it R/O).
> Performance: Real-Time
> Fault-tolerance: Best if existent, but not strictly required (data is not
> critical).
> Number of nodes: 2, but I'd prefer not stricting scalability.
> Licensing: GPL preferred, other non-paid are acceptable.
> Eugene, you mentined a third machine. That is out of question, for now. I
> wouldn't have this problem, if I had it (which then would have to handle
> failover). However, you mentioned a HA NFS server, which is somewhat what
> I need - but you are using FC on hardware RAID. Can you do the HA NFS
> without that third box?

I did *not* mention a third machine, reread my post.  My proposal was
this: you have two machines, say, 'alfa' and 'beta'.  You make a HA NFS
cluster out of them; there may be several ways but let's assume you use
DRBD and Heartbeat.  This is pretty straightforward, there are HOWTOs on
the Net.

Your HA NFS server has an IP address "migrating" between 'alfa' and
'beta', we can call this address, say, 'omega'.  So, 'omega' is not a
real machine, but if you have any arbitrary client machines on the
network, they can "mount -t nfs omega:/export /home".

Now, I am getting to the point.  Machines 'alfa' and 'beta' are *no
different* from any other client machines, despite they are acting as
the server.  So, if you do "mount -t nfs omega:/export /home" on both
alfa and beta, this /home will be the same directory on both nodes. (You
must be sure that NFS shares are mounted *after* startup of heartbeat. 
E.g. by using autofs to mount /home/... on demand).

Final note: mandatory locking approach is hostile to UNIX, and you
generally should not rely on it, whatever technology you choose.


More information about the drbd-user mailing list