I had a lot of difficulty on one of these machines with the install. As it turns out, it was due to me trying to choose options during the install which the bootable install disk simply didnt like. I was trying to change partition sizes, change default install packages, and tune the way the install was to take place. Apparently this was designed simply to be done as a "take all defaults" type of install, and then tune everything later. This is ultimately what I had to do to get this to work.
Current System(s) Configuration :
Component | System : SuSE1 | System : Suse2 |
MotherBoard | Cyrix | Intel |
Processor | Cyrix 6x86 166+ | Intel Pentium Pro 200Mhz |
Memory | 96 Mb 72 Pin SIMM's | 128 Mb 72 Pin SIMM's |
I/O Controller | OnBoard PCI | Adaptec 2940 |
Storage | 4.3 Gig Maxtor EIDE | 9.1 Gig Seagate Barracuda SCSI - ST19101W |
CD/DVD | BenQ 56x CDRom | HP DVD-Rom 305 |
Network | 3com 3c509-Combo (ISA) | 3com 3c509-TPO (ISA) |
Video | Matrox Millenia 4Mb (PCI) | Trident 9440 1Mb (PCI) |
Pointer | PS/2 Mouse | PS/2 Mouse |
First thing to do is to go to suse.com and download the installation disk1 cdrom image and burn it. If you dont have a bootable cdrom, its a lot more difficult to make all the floppy diskettes with modules, etc (if you even have a spare floppy drive). Since this proved too much difficulty for me and my spare parts bin, I decided that it was easier to go SCSI intead.
Perhaps at some point, I will pen down all the installation notes, but for now, the main objective is to document how to work with the DRBD facility.
- Locate and download the drbd-0.6.6-165.i586.rpm and install it. It may have been avialable directly from SuSE, but I had difficulty finding it, and just went with the rpmfind.net option of pulling down the RPM. The kernel module for drbd was in place already and was version 0.6.6, which is what forced me to stick with that version for the binary support tools. Newer versions were available, but I stayed consistent at 0.6.6.
- Filesystem must be the same size, and type on both nodes for this to work in the easiest manner. I went with a sample filesystem of 376960 blocks, since that was the size of my secondary IDE drive in suse1. I used the "mkfs -v /dev/hdb1 376960" command on suse2 and "mkfs -v /dev/sda3 376960" command on suse2 to build my filesystems.
- Modify the /etc/fstab on both nodes. Setup a new line for the /dev/nb0 device we will be creating for the replication device. I decided to mount it at "/replication", so my entry looked like "/dev/nb0 /replication ext2 defaults 0 0". This should be done on both nodes. This will lookup the information in the drbd.conf file to figure out what is what. Here is a copy of one of mine.
- Once the filesystems are created, modify the /etc/drbd.conf file to contain the proper sizes in the "disk-size" parameter, and so that you can get all the other variables defined for the configuration. Here is a sample drbd.conf file from suse2.
- Once this is done on both nodes, you are ready to begin. Run the "/etc/init.d/drbd start" command on each node. The first one that runs it will assume its the primary, however this can be overridden.
- I chose to have suse1 be the primary and suse2 be the secondary, so I ran the following commands to configure that : "drbdsetup /dev/nb0 primary" on suse1 and "drbdsetup /dev/nb0 secondary" on suse2.
- Then I ran "/etc/ha.d/resource.d/datadisk drbd0 start" on suse1 to get the filesystem mounted on the primary node. Thats it.
- To stop the whole process, run the "/etc/init.d/drbd stop" command.
- And finally, to force it to restart after a crash/reboot/restart - run the "chkconfig --edit drbd" and set the value to on. This will start it in runlevels 3 and 5 which is perfect.
In order to switch control of writes from primary to secondary, run this on the primary "/etc/ha.d/resource.d/datadisk drbd0 stop", and on the secondary run the "/etc/ha.d/resource.d/datadisk drbd0 start" commands. I have not yet setup full failover functionality, so I have not automated this yet.
Some other useful status commands, or ways to check health and configuration :
- cat /proc/drbd
- /etc/init.d/drbd status
- /etc/ha.d/resource.d/datadisk drbd0 status
- mount
Thats pretty much it. Then it was just a bunch of testing and further tuning.