[DRBD-user] DRBD and LVM Snapshot with 2 nodes configuration

Andreas Semt as at computer-leipzig.de
Wed Apr 7 21:09: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.


Lars Ellenberg wrote:

> / 2004-04-07 01:22:33 +0200
> \ Andreas Semt:
> 
>>I believed only a copy of the original data blocks (or Logical Extents) 
>>are copied to the snapshot, if these data blocks on the LV were changed?
> 
> 
> that is what I am saying :)
> the difference is *when* does the copy takes place. and thats not when
> you set up the COW table (create the snapshot), but "just in time" when
> the data blocks change later on.

Right, that's the great advantage of LVM snapshot facility.
>  
> If you have more than one DRBD as PV in the same VG, you have to make
> sure that you always fail over all dependant PVs *at the same time!*
> And you should make sure that all of them live on some local RAID.

Yes, only one Raid.
> 
> 
> there IS NO underlying FS.
> The filesystem is ON TOP of the block device.
> And if it is not mounted, there is no point in notifying it
> about anything...
> 

Okay, that's right of course. I think i am aware of this fact (meanwhile).
>>After snapshot creation, I can put drbd online again and drbd AND lvm 
>>working with the same data (the fs sees only the /dev/nb0 device). Right?
> 
> 
> yes.
> 

Okay, now I have two possible ways to go, but can I suggest a third way
(cause I won't use LVM2, so only one way left ...)?

The situation is:

nodeA (Heartbeat and drbd active), nodeB (Heartbeat and drbd standby).
To make a clean and consistent snapshot i will do following (all on nodeB!):
a) stop heartbeat (at 02.00 pm per cron for example), i.e. that means
    for heartbeat: "nodeB is dead!, i am the only one left!"
b) -> result: no further drbd mirroring will be done, the master is
    still the master (nodeA), nodeA and nodeB knows nothing from each
    other
c) shut down drbd (or heartbeat shut down drbd)
d) "lvcreate snapshot" for the drbd block devices / do anything with the
    snapshot
e) bring drbd up again and start heartbeat (or heartbeat brings drbd up
    again)
f) synch between nodeA to nodeB will be started

What does this look like? Good/bad? Some "thinkos" anywhere?

Pro: nodeA is still active / services are online
Con: How to say drbd that is will be shut down in 5 minutes (it is 01:55
pm, heartbeat/drbd shutdown at 02:00 pm)? Does exists a command for drbd
to say: "In five minutes you will lost your connection to your primary
partner, so please write all the stuff in the buffer (of nodeA
(primary)) and then disconnect and stay on your own"? or to say to the
primary partner: "Please write all your pending data (from the buffer)
to your partner (in secondary state), cause that is the last chance if
you won't like the idea of inconsistent data between you and your partner"?

Please give me some thoughts about this concept!

Thank you very much indeed!

-- 
Best regards,
Andreas Semt





More information about the drbd-user mailing list