drbd-user March 2010 archive
Main Archive Page > Month Archives  > drbd-user archives
drbd-user: Re: [DRBD-user] Broken mysql replication

Re: [DRBD-user] Broken mysql replication

From: Lars Ellenberg <lars.ellenberg_at_nospam>
Date: Wed Mar 17 2010 - 11:15:22 GMT
To: drbd-user@lists.linbit.com

On Wed, Mar 17, 2010 at 11:48:27AM +0100, Jordi Espasa Clofent wrote:
> Ok, after some test work I've realized that the real problem is:
>
> - If you perform a very aggressive shutdown (as power off directly
> is) to the active node, the pasive node hasn't all the records and
> mysql slave loses replication.
>
> - if you perform a regular shutdown to the active node, passive node
> has all data and mysql slave keeps up with replication
>
> So, it seems taht the problem to deal with is try to make data
> replication as safe as possible between active and passive drbd
> nodes.
>
> ¿Some tricks to do it?

Please clarify: are you atempting mysql replication,
as in "SET MASTER TO ..."?
Then this has nothing to do with DRBD.

If you "just" have your mysql data on DRBD,
and do "simple" data replication there,
please avoid the term "mysql replication",
as that is already an established term with its own meaning.

You have to realize that:

 * DRBD won't make your applications crash safe, if they are not
 * to make your applications DRBD failover safe,
   you first have to make them crash safe
   (do not use myisam, for example)
 * disable all _volatile_ caches (disk, controller etc)
 * use DRBD protocol C
 * _forget_ about all those "performance tuning" options
   like disabling fsync or increasing flush-logs-to-disk intervalls
   and similar, they all mean: dont write to disk.
   "disk" in that case is DRBD, and
 * data that has not yet been "synced" to "disk"
   has not yet reached DRBD,
   and thus cannot possibly be replicated by DRBD

As an experiment: don't do DRBD, just crash your box.
Then see how much data is "missing".

If you cannot get that down to zero, you can not expect DRBD to
magically immagine the missing data for you just in time for failover
to work "as expected" ;-)

Hth,

-- : Lars Ellenberg : LINBIT | Your Way to High Availability : DRBD/HA support and consulting http://www.linbit.com DRBD® and LINBIT® are registered trademarks of LINBIT, Austria. __ please don't Cc me, but send to list -- I'm subscribed _______________________________________________ drbd-user mailing list drbd-user@lists.linbit.com http://lists.linbit.com/mailman/listinfo/drbd-user