Testing the DRBD Service

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.

  1. Test the DRBD service on node 1.

    1. Open a terminal console, then log in as the root user or equivalent.

    2. Create a mount point on node 1, such as /srv/r0mount, by entering

      mkdir -p /srv/r0mount
      
    3. Mount the drbd device by entering

      mount -o rw /dev/drbd0 /srv/r0mount
      
    4. Create a file from the primary node by entering

      touch /srv/r0mount/from_node1
      
  2. Test the DRBD service on node 2.

    1. Open a terminal console, then log in as the root user or equivalent.

    2. Dismount the disk on node 1 by typing the following command on node 1:

      umount /srv/r0mount
      
    3. Downgrade the DRBD service on node 1 by typing the following command on node 1:

      drbdadm secondary r0
      
    4. On node 2, promote the DRBD service to primary by entering

      drbdadm primary r0
      
    5. On node 2, check to see if node 2 is primary by entering

      rcdrbd status
      
    6. On node 2, create a mount point such as /srv/r0mount, by entering

      mkdir /srv/r0mount
      
    7. On node 2, mount the DRBD device by entering

      mount -o rw /dev/drbd0 /srv/r0mount
      
    8. 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.

  3. If the service is working on both nodes, the DRBD setup is complete.

  4. Set up node 1 as the primary again.

    1. Dismount the disk on node 2 by typing the following command on node 2:

      umount /srv/r0mount
      
    2. Downgrade the DRBD service on node 2 by typing the following command on node 2:

      drbdadm secondary r0
      
    3. On node 1, promote the DRBD service to primary by entering

      drbdadm primary r0
      
    4. On node 1, check to see if node 1 is primary by entering

      rcdrbd status
      
  5. 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”.