[DRBD-user] drbd newbie

Sven Mueller sm+drbd at ciphirelabs.com
Sat May 7 00:02:05 CEST 2005

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


Tim Hibbard wrote on 06/05/2005 22:20:
> I have two servers connected to a shared storage device (server1 and server2).
> We also have a 'slave' machine on the network which I would like to have all 
> data duplicated to in case of an 'emergency'.

So you have
server1 and server2 use a shared storage device and want a replication
of that device on your "slave" machine?

Interesting setup, but very unusual AFAICT.

> haresources:
> ==========
> server1 datadisk::drbd0 Filesystem::/dev/drbd0::/home Filesystem::/dev/sda1::/usr/local/apache 192.168.0.1 apache
> server2 Filesystem::/dev/sda3::/usr/local/mysql 192.168.0.2 mysql

So when server1 fails, you want server2 to mount /home and take over
control of /dev/drbd0, right?

> The mysql database has built-in replication happening with the slave machine.  
> Also the data is saved once an hour with mysql_dump.  It it possible to replicate 
> the data in /usr/local/mysql database with drbd?  Could this cause corruption/unreliability 
> in the database files located on the slave node?

It's not inherently causing that kind of problem, but you might get a
replication of a corrupt database. Is there a reason _not_ to use
MySQL-Replication to get a copy of your main (server1/server2) database
to the slave? I'm not sure, but IIRC, Mysql 4.1 can handle multi-master
replication or more precisely: automatic master selection.

> Here are my config files.  Any feedback is greatly appreciated.

It looks godd AFAICT. However, for you setup to work, you will need to
stop drbd on primary server when it gives up HA-Resources. It _might_
work like this in haresouces:

server1 drbd datadisk::drbd0 Filesystem::/dev/drbd0::/home
Filesystem::/dev/sda1::/usr/local/apache 192.168.0.1 apache

server2 Filesystem::/dev/sda3::/usr/local/mysql 192.168.0.2 mysql

Note that the first two lines should actually be one line. The "drbd" in
front of datadisk::drbd0 should cause heartbeat to completely stop the
drbd system on server1 when giving up resources and cause server2 to
start the drbd subsystem once it takes over resources.
DO NOT start drbd in /etc/rc?.d/*. DO NOT place any drbd/drbdadmin calls
into apache startup scripts. That simply doesn't make sense.

cu,
sven



More information about the drbd-user mailing list