If the install and configuration procedures worked as expected, you are ready to run a basic test of the DRBD functionality. This test also helps with understanding how the software works.
Test the DRBD service on node 1.
Open a terminal console, then log in as the
root user or equivalent.
Create a mount point on node 1, such as
/srv/r0mount, by entering
mkdir -p /srv/r0mount
Mount the drbd device by entering
mount -o rw /dev/drbd0 /srv/r0mount
Create a file from the primary node by entering
touch /srv/r0mount/from_node1
Test the DRBD service on node 2.
Open a terminal console, then log in as the
root user or equivalent.
Dismount the disk on node 1 by typing the following command on node 1:
umount /srv/r0mount
Downgrade the DRBD service on node 1 by typing the following command on node 1:
drbdadm secondary r0
On node 2, promote the DRBD service to primary by entering
drbdadm primary r0
On node 2, check to see if node 2 is primary by entering
rcdrbd status
On node 2, create a mount point such as
/srv/r0mount, by entering
mkdir /srv/r0mount
On node 2, mount the DRBD device by entering
mount -o rw /dev/drbd0 /srv/r0mount
Verify that the file you created on node 1 is viewable by entering
ls /srv/r0mount
The /srv/r0mount/from_node1 file should be
listed.
If the service is working on both nodes, the DRBD setup is complete.
Set up node 1 as the primary again.
Dismount the disk on node 2 by typing the following command on node 2:
umount /srv/r0mount
Downgrade the DRBD service on node 2 by typing the following command on node 2:
drbdadm secondary r0
On node 1, promote the DRBD service to primary by entering
drbdadm primary r0
On node 1, check to see if node 1 is primary by entering
rcdrbd status
To get the service to automatically start and fail over if the server has a problem, you can set up DRBD as a high availability service with OpenAIS. For information about installing and configuring OpenAIS for SUSE Linux Enterprise 11 see Part II, “Configuration and Administration”.