<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/1.0.4">
</HEAD>
<BODY>
On Wed, 2005-03-23 at 10:29, Philipp Reisner wrote:
<BLOCKQUOTE>
<PRE><FONT COLOR="#737373"><FONT SIZE="3"><I>Am Dienstag, 22. März 2005 17:48 schrieb Filip Sergeys:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Hello,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> Maybe my input can help you convince. Indeed mounting read only does</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> come in very handy for database logfiles.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> This is the situation:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> A masterdatabase which is online</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> A slavedatabase which is in standby</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> In normal operations:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> ------------------------</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> The masterdatabase writes duplexed log files and archived log files to</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> the primary drbd device.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> At night the slavedatabase "wakes up" mounts the secondary drbd device</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> read only and applies the past 24 hours of changes captured in the</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> archived and the online redo log files. When done, the database goes</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> back to standby and the device is umounted.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> To be more precise, in reality, I mount the device, copy the changes</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> since last night to a local device, unmount, and then work with the</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> local copies. The reason? I don't know how the slavedatabase would react</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> if the online redologfiles changed will rolling forward.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> So far this could also be done with NFS</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> When a failure happens on the masterdatabase and it goes down:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> ---------------------------------------------------------------------------</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> the slavedatabase kicks in (via heartbeat) mounts the drbd device in</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> primary, applies the changes since midnight and fires up in online</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> state.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> This could not be done with NFS because you wouldn't have access</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> anymore. rsync is not an option either because you need the committed</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> changes up to the very last second.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> I think this is a very common setup and drbd is a magnificent tool to</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> reach the goal for this.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>> So hope this is convincing enough ;)</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>This reasoning is exactly the reason why we prohibit mounting the secondary.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>I assume that you use a filesystem like ext3, XFS or reiserfs.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>For the short time you mount it on the seconary, the primary may</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>modify it...</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Just consider this... the FS on the secondary reads an inode...,</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>then the FS is modified by the primary, then the FS on the secondary</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>wants to read the data blocks, that are referenced by the inode....</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>But in the meantime these data blocks where relocated by the other machine...</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>My experiences are:</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I> - ext2/ext3 will print some assertions to the kernel log, return an error</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I> to the application that wanted to read the file and continue to</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I> run.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I> - reiserfs will crash the machine.</FONT></FONT></I></PRE>
</BLOCKQUOTE>
<FONT SIZE="3">That means I have been a lucky bastard the last few months. I use reiserfs .... hmmm, I better a solution quick !</FONT>
<BR>
<FONT SIZE="3">Would a better way be to drbdsetup /dev/nb0 disconnect before mounting read only, do my stuff, unmount, and then run drbdsetup /dev/nb0 net xyz to bring it in secondary state again?</FONT>
<BLOCKQUOTE>
<PRE><FONT COLOR="#737373"><FONT SIZE="3"><I> - XFS I do not know.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>Please hold you feets still until DRBD-0.8 is released. In DRBD-0.8 we</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>will support primary/primary, and with on of OCFS2, openGFS or GFS</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>you will be able to build such a setup.</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I></FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>-Philipp</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>-- </FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>: Dipl-Ing Philipp Reisner Tel +43-1-8178292-50 :</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :</FONT></FONT></I>
<FONT COLOR="#737373"><FONT SIZE="3"><I>: Schönbrunnerstr 244, 1120 Vienna, Austria http://www.linbit.com :</FONT></FONT></I></PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>--
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
* System Engineer, Verzekeringen NV *
* www.verzekeringen.be *
* Oostkaai 23 B-2170 Merksem *
* 03/6416673 - 0477/340942 *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>