Cheap VPS & Xen Server

Residential Proxy Network - Hourly & Monthly Packages

How To Upgrade DRBD Userland Version To 8.3.9 Under OpenSUSE 11.4


When you try to run a cluster server with corosync, drbd, ocfs2 and pacemaker, and you try to install default drbd package under OpenSUSE 11.4 through yast or zypper, you may face the same problem as me:

1

The system reports that:

Starting DRBD resources: DRBD module version: 8.3.9
userland version: 8.3.8
you should upgrade your drbd tools!

and you cannot go further. We either wait till the OpenSUSE community releases new drbd packages which match the kernel-builtin module, or download drbd source code and upgrade drbd userland to 8.3.9 based on kernel source tree.

This documentation shows you how to compile the drbd package 8.3.9 based on the OpenSUSE 11.4 kernel source tree (we do need to build the kernel source tree, but we do not need to recompile the kernel). It is for test purposes only, and it works for my working environment and I cannot guarantee that this works for you.

Please contact me if you have any questions: wintel2006@hotmail.com. Thanks.

In this tutorial I will run 2 OpenSUSE 11.4 32-bit servers under VMware Workstation, both servers were built from OpenSUSE 11.4 live-CD, which you can download from http://www.opensuse.org.

Both servers have 2 disks:

/dev/sda: OpenSUSE system OS;

/dev/sdb: for DRBD only

Server names and network addresses:

drbd1: 192.168.5.129

drbd2: 192.168.5.137

 

Step 1. Install kernel-source, gcc, flex, make On Both Servers

zypper install kernel-source gcc flex make

2

After installation, you will see:

3

Before we do any work, we need to work on the kernel first, now switch to /usr/src/linux, and create a copy of the .config file of the current-running kernel:

cd /usr/src/linux
cp /boot/config-2.6.37.1-1.2-desktop ./.config

4

To make menuconfig compile the kernel, we need the ncurses-devel package:

zypper install ncurses-devel

5

And now run make menuconfig:

make menuconfig

In the following screen, highlight “Load an Alternate Configuration File”, and click enter:

6

In the new window, .config file is auto selected; now click enter:

7

Select exit, and save the changes. Now the kernel source tree is ready to be used for compiling the drbd source code.

8

Select exit, and save the changes. Now the kernel source tree is ready to be used for compiling the drbd source code.

9

Step 2. Now download drbd 8.3.9 which matches the kernel built-in module, unzip it, and prepare the installation on both servers

cd ../
wget http://oss.linbit.com/drbd/8.3/drbd-8.3.9.tar.gz
tar zxvf drbd-8.3.9.tar.gz

10

Step 2. Now download drbd 8.3.9 which matches the kernel built-in module, unzip it, and prepare the installation on both servers

cd ../
wget http://oss.linbit.com/drbd/8.3/drbd-8.3.9.tar.gz
tar zxvf drbd-8.3.9.tar.gz

11

Now compile drbd (I need to enable pacemaker for heartbeat cluster purposes). See the following four screenshots please.

cd drbd-8.3.9/
./configure –prefix=/usr –localstatedir=/var –sysconfdir=/etc –with-utils –with-pacemaker
make KDIR=/usr/src/linux
make install

12

13

14

15

Now create the default /etc/drbd.conf configuration file, and this is my configuration file:

global {
    usage-count no;
}
common {
    syncer { rate 100M; }
    protocol      C;
}
resource postgres {
    startup {
       wfc-timeout 0;
       degr-wfc-timeout
       120;
    }
    disk { on-io-error detach; }
    on drbd1 {
       device      /dev/drbd0;
       disk        /dev/sdb;
       address     192.168.5.129:7791;
       meta-disk   internal;
    }
    on drbd2 {
       device      /dev/drbd0;
       disk        /dev/sdb;
       address     192.168.5.137:7791;
       meta-disk   internal;
    }
}

16

And here is the /etc/hosts file on drbd1:

192.168.5.137       drbd2.site drbd2
192.168.5.129       drbd1.site drbd1
17

Step 3. Copy /etc/drbd.conf and /etc/hosts from server drbd1 to server drbd2

scp /etc/hosts drbd2:/etc
scp /etc/drbd.conf drbd2:/etc

18

Step 4. Configure DRBD on both drbd1 and drbd2

drbdadm create-md postgres
modprobe drbd
drbdadm up postgres

19

20

Step 5. Now activate the primary node on either server, drbd1 or drbd2 (NOT BOTH), and I choose drbd2:

drbdadm — –overwrite-data-of-peer primary postgres

21

You could check the initialization process on both servers with:

cat /proc/drbd

22

23

Step 6. Start drbd server on both servers

/etc/init.d/drbd start

Check drbd status on server drbd1 (secondary/primary):

24

And check drbd status on server drbd2 (primary/secondary):

25

Bingo, it works now. From this point you can go ahead and test drbd, mysql/postgresql active/passive server. There are tons of documentations online talking about this topic.

Comments

comments