[Pacemaker] First Cluster

Digimer lists at alteeve.ca
Mon Feb 25 20:38:53 UTC 2013


On 02/25/2013 03:27 PM, Omar Quijano wrote:
> Greetings,
>
> I am setting up a fail-over cluster for the first time. In the process
> of following the documentation: Cluster from Scratch, I am having
> difficulties understanding the DRBD configuration and procedure. The
> purpose of the cluster is to provide: mail, dns, nis, syslong, and web
> (wiki and calendar) services. I have created a 250GB partition for DRBD.
> My plan is to store all the data of the services in this partition:
> /dev/drbd1/postifx, /dev/drbd1/nis, /dev/drbd1/wiki, etc., just to name
> a few. Or, is the correct procedure to create a different resource,
> disk, and device for each service: /dev/drbd1/postfix, /dev/drbd2/nis,
> /dev/drbd3/wiki, etc. If this is correct, I will have distinct resource
> name, disk size, and device name? Meaning, I will have to create several
> logical volumes? Also, I was wondering if you could give me an advice
> whether to make my cluster active/active or leave it active/passive.
>
> Thank you for your time and support,
>

The /dev/drbdX device is a raw block device. Think of it like /dev/sda3 
or similar. So you format it and then mount it's file system somewhere. 
So for example, say you have;

node01:/dev/sda5 + node02:/dev/sda5 ==> /dev/drbd0

Now you want simple fail-over, so you setup DRBD to have one primary at 
a time only (called "single primary"). You would then make node01 the 
primary device and leave node02 as the secondary, backup node.

With node01 being primary, you would use it to format, say, ext4 onto 
the new /dev/drbd0 device;

mkfs.ext4 /dev/drbd0

Then you can mount it, say on /shared;

mount /dev/drbd0 /shared

Now you can create directories and store data shared. Using your 
example, you would create;

mkdir /shared/postfix
mkdir /shared/nis

and so on.

You will not be able to mound /dev/drbd0 on the backup server. You can't 
even mount it read-only. Node 02 will sit there getting a copy of every 
change made to /dev/drbd0 though.

So say one day that node 01 totally fails. You would be able to 
"promote" node02 from Secondary to Primary and then mount it's 
/dev/drbd0 on /shared, restart the applications and be back up and running.

This is a pretty simple over view, but hopefully it helps you see how 
DRBD works a little better.

-- 
Digimer
Papers and Projects: https://alteeve.ca/w/
What if the cure for cancer is trapped in the mind of a person without 
access to education?




More information about the Pacemaker mailing list