Show Table of Contents
Chapter 3. GNBD Driver and Command Usage
The Global Network Block Device (GNBD) driver allows a node to export its local storage as a GNBD over a network so that other nodes on the network can share the storage. Client nodes importing the GNBD use it like any other block device. Importing a GNBD on multiple clients forms a shared storage configuration through which GFS can be used.
The GNBD driver is implemented through the following components.
gnbd_serv— Implements the GNBD server. It is a user-space daemon that allows a node to export local storage over a network.
gnbd.ko— Implements the GNBD device driver on GNBD clients (nodes using GNBD devices).
Two user commands are available to configure GNBD:
3.1. Exporting a GNBD from a Server
gnbd_servdaemon must be running on a node before it can export storage as a GNBD. You can start the
gnbd_servgnbd_serv: startup succeeded
Once local storage has been identified to be exported, the
gnbd_exportcommand is used to export it.
When you configure GNBD servers with device-mapper multipath, you must not use page caching. All GNBDs that are part of a logical volume must run with caching disabled. By default, the
gnbd_exportcommand exports with caching turned off.
A server should not import the GNBDs to use them as a client would. If a server exports the devices uncached, the underlying devices may also be used by
- Specifies a storage device to export.
- Specifies an arbitrary name selected for the GNBD. It is used as the device name on GNBD clients. This name must be unique among all GNBDs exported in a network.
- Export the device as read-only.
- Enable caching. Reads from the exported GNBD and takes advantage of the Linux page cache.By default, the
gnbd_exportcommand does not enable caching.
WarningWhen you configure GNBD servers with device-mapper multipath, do not specify the
-coption, as this lead sto data corruption. All GNBDs that are part of a logical volume must run with caching disabled.
NoteIf you have been using GFS 5.2 or earlier and do not want to change your GNBD setup you should specify the
-coption. Before GFS Release 5.2.1, Linux caching was enabled by default for
gnbd_export. If the
-coption is not specified, GNBD runs with a noticeable performance decrease. Also, if the
-coption is not specified, the exported GNBD runs in timeout mode, using the default timeout value (the
-toption). For more information about the
gnbd_exportcommand and its options, refer to the
- Manually sets the Universal Identifier for an exported device. This option is used with
-e. The UID is used by device-mapper multipath to determine which devices belong in a multipath map. A device must have a UID to be multipathed. However, for most SCSI devices the default Get UID command,
/usr/sbin/gnbd_get_uid, will return an appropriate value.
NoteThe UID refers to the device being exported, not the GNBD itself. The UIDs of two GNBD devices should be equal, only if they are exporting the same underlying device. This means that both GNBD servers are connected to the same physical device.
WarningThis option should only be used for exporting shared storage devices, when the
commandoption does not work. This should almost never happen for SCSI devices. If two GNBD devices are not exporting the same underlying device, but are given the same UID, data corruption will occur.
- Gets the UID command. The UID command is a command the
gnbd_exportcommand will run to get a Universal Identifier for the exported device. The UID is necessary to use device-mapper multipath with GNBD. The command must use the full path of any executeable that you wish to run. A command can contain the %M, %m or %n escape sequences. %M will be expanded to the major number of the exported device, %m will be expaned to the minor number of the exported device, and %n will be expanded to the
sysfsname for the device. If no command is given, GNBD will use the default command
/usr/sbin/gnbd_get_uid. This command will work for most SCSI devices.
This example is for a GNBD server configured with GNBD multipath. It exports device
gamma. Cache is disabled by default.
gnbd_export -d /dev/sdc2 -e gamma -U
This example is for a GNBD server not configured with GNBD multipath. It exports device
deltawith cache enabled.
gnbd_export -d /dev/sdb1 -e delta -c
This example exports device
deltawith cache enabled.
gnbd_export -d /dev/sdb2 -e delta -c