Getting High With Lenny - Page 3

Want to support HowtoForge? Become a subscriber!
 
Submitted by randall (Contact Author) (Forums) on Tue, 2009-02-17 11:42. ::

Configure LVM2

 

LVM man pages

LVM will normally scan all available devices under /dev, but since /dev/cciss/c0d0p6 and /dev/drbd0 are basically the same this will lead to errors where LVM reads and writes the same data to both devices. So to limit it to scan /dev/drbd devices only we do the following on both nodes.

cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.original

nano /etc/lvm/lvm.conf

    #filter = [ "a/.*/" ]
    filter = [ "a|/dev/drbd|", "r|.*|" ]

To re-scan with the new settings on both nodes:

vgscan

 

Create the Physical Volume

The following only needs to be done on the node that is the primary!!, the second node will copy this automatically. On node1:

pvcreate /dev/drbd0

 

Create the Volume Group

On node1:

vgcreate drbdvg0 /dev/drbd0

 

Create the Logical Volume

In this example about 50GB, this leaves plenty of space to expand the volumes or to add extra volumes later on. For this example we will make a Vserver called "web" so I will name the Logical Volume it will be placed on the same. On node1:

lvcreate -L50000 -n web drbdvg0

Then we put a file system on the logical volume.

mkfs.ext3 /dev/drbdvg0/web

Create the directory where we want to mount the Vservers, the big data partition is mounted on /VSERVERS in this example.

mkdir -p /VSERVERS/web

Mount the volume group to the mount point:

mount -t ext3 /dev/drbdvg0/web /VSERVERS/web/

 

Get informed

 

Postfix man pages

 

Of course we want to be informed by heartbeat in case a node goes down, so we install postfix on both machines to send the mail...

apt-get install postfix mailx

... and go for the defaults, "internet site" and "node1.example.com". We don't want postfix to listen to all interfaces,

nano /etc/postfix/main.cf

and change the line at the bottom to read like this:

inet_interfaces = loopback-only

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.