![]() |
After the initial install, the first thing to do is set up and configure DRBD. DRBD is a kernel module that talks to the hardware at the lowest level. In our scsi raid configuration sda6 is the mirrored partition. First we must get the drives in sync, so any changes to one will propogate to the other. We tell DRBD which device to initialize, which host is the primary and how to contact the secondary host, and which protocol to use to communicate between the hosts. DRBD has three protocols for communication between hosts, A,B and C.
On campeche (host 1) the following commands are issued:
drbdsetup /dev/nb0 disk /dev/sda6
drbdsetup /dev/nb0 net 172.16.1.1 172.16.1.2 C
drbdsetup primary
On chihuahua (host 2) we issue these commands:
drbdsetup /dev/nb0 disk /dev/sda6
drbdsetup /dev/nb0 net 172.16.1.2 172.16.1.1 C
drbdsetup secondary
drbdsetup /dev/nb0 syncer -min 4M -max 600M -nice 0
The last command will consume a lot of your resources and perhaps make the system a little slow, while the drives get in sync. Over the crossover connected gigabit ethernet connection on the Intel servers it takes about an hour to sync 64Gb of drive partitions.
To check on the process you can check the proc filesystem.
cat /proc/drbd
version: 0.6.6 (api:62/proto:62)
0: cs:Connected st:Primary/Secondary ns:66264920 nr:66100012 dw:132364928
dr:20298744 pe:0 ua:0
1: cs:Unconfigured st:Secondary/Unknown ns:0 nr:0 dw:0 dr:0 pe:0 ua:0
The lines tell you the state of drbd. Here is a table of fields and
possible values.
Field | Description | Possible Values |
[0-9] | /dev/nb[[0-9] | numerical description of device |
cs: | connection state | Unconfigured: Device Waits for configuration |
Unconnected: Transitory state, while bind() blocks | ||
WFConnection: Device Waits for configuration of other side | ||
WFReportParams: Transitory state, while waiting for first packet on new TCP connection | ||
SyncingAll: All blocks of the primary node are being copied to the secondary node | ||
SyncingQuick: The secondary is updated, by copying the block which were updated since the now secondary node left the cluster |
||
Connected: Everything is fine. | ||
Timeout: Transitory state | ||
st: | state: device role | |
local/remote Primary | ||
Secondary | ||
Unknown (which is not a role) | ||
ns: | network send | number of blocks |
nr: | network receive | number of blocks |
dw: | disk write | number of blocks |
dr: | disk read | number of blocks |
of: | on the fly (outdated) | number of blocks |
pe: | pending | number of blocks: |
ua: | unacknowledged | number of blocks (be happy that this is zero) |
Next create a file system on /dev/nb0 and mount it to a mount point. We used /mnt since SuSE mounts things like floppy drives to /media/floppy and CDROM drives to /media/cdrom.