[DRBD-user] Backing up MySQL data in DRBD Cluster

Dan Frincu df.cluster at gmail.com
Wed Mar 30 10:53:21 CEST 2011

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


Hi,

On Wed, Mar 30, 2011 at 12:37 AM, Mateusz Kalisiak <mk.spare999 at gmail.com>wrote:

> Hello Everyone,
>
> I'd like to setup the standard MySQL-DRBD-HA architecture:
> - PRIMARY server with MySQL and mounted /dev/drbd0,
> - SECONDARY just being standalone and waiting for failover.
> Additionally, during normal cluster activity (primary server is fine and
> active) I'd like to perform backup of MySQL data, but using only SECONDARY
> node.
> Did anyone tried such thing?
>

If it's an actual HA architecture, the primary node is the only place where
read/write operations are possible. On the secondary node, you cannot mount
the /dev/drbd0, not even as read-only. If you search a little bit on the
archives, you'll see why mounting the drbd device on the secondary node as
read-only has bad consequences as well.

An MySQL Active-Active setup _might_ seem like a good idea for the case you
want to achieve, but the implementation behind the idea, to keep it all
working as expected is troublesome to say the least. The replication
channels on the Active-Active MySQL setup need to be redundant, and when one
replication channel fails there is no automatic recovery for it. So a
resource agent that knows how to handle this type of behavior is required.

Then with the Active-Active setup, on the storage level, you need a
dual-primary setup. That involves a cluster filesystem with a distributed
locking manager to prevent concurrent access to the same data. Also being an
Active-Active setup, and assuming that the frontend is only trying to
connect to one of the instances of the MySQL database (no load balancing),
then extra care must be taken with the VirtualIP assignment to the proper
(primary) node since both nodes will run the same resource (MySQL) at the
same time.

When all of the above are met, then and only then will you be able to
perform a backup on the secondary node.

Another option would be to have a second MySQL resource run in a Slave mode
(read-only) and have it run always on the secondary node.

So node1 is primary, it holds MySQL Master (read-write), node 2 is
secondary, holds MySQL Slave (read-only). Primary node replicates MySQL
Master read/write data to secondary. Secondary node replicates MySQL Slave
read-only data to primary. Thus you can always perform the backup from the
secondary node.
--------------------------------------------------------------
Primary ---------------------------------Secondary
--------------------------------------------------------------
MySQL---->---replication----->----MySQL
Master                                    Master
--------------------------------------------------------------
MySQL----<---replication-----<----MySQL
Slave                                      Slave
--------------------------------------------------------------

Regards,
Dan


> Maybe such feature would be available somehow in ACTIVE-ACTIVE architecture
> (although according to MySQL docs it's not
> http://dev.mysql.com/doc/refman/5.0/en/drbd-architecture.html#qandaitem-B-14-3-1-1)
>
> Regards,
> Mateusz
>
>
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user
>
>


-- 
Dan Frincu
CCNA, RHCE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20110330/9bcec647/attachment.htm>


More information about the drbd-user mailing list