GNBD (Global Network Block Device) provides block-level storage access over an Ethernet LAN. GNBD components run as a client in a GFS node and as a server in a GNBD server node. A GNBD server node exports block-level storage from its local storage (either directly attached storage or SAN storage) to a GFS node.
This chapter describes how to use GNBD with Red Hat GFS and consists of the following sections:
Multipath GNBD is not available with Red Hat GFS 6.1. That is, device mapper multipath (dm-multipath) cannot use GNBD. GNBD without multipath is available.
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:
gnbd_export (for servers) — User program for creating, exporting, and managing GNBDs on a GNBD server.
gnbd_import (for clients) — User program for importing and managing GNBDs on a GNBD client.
The gnbd_serv daemon must be running on a node before it can export storage as a GNBD. You can start the gnbd_serv daemon running gnbd_serv as follows:
#gnbd_serv gnbd_serv: startup succeeded
Once local storage has been identified to be exported, the gnbd_export command is used to export it.
A server should not import the GNBDs to use them as a client would. If a server exports the devices uncached, they may also be used by ccsd and gfs.
gnbd_export -d pathname -e gnbdname [-c]
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_export command does not enable caching.
If you have been using GFS 5.2 or earlier and do not want to change your GNBD setup you should specify the -c option. Before GFS Release 5.2.1, Linux caching was enabled by default for gnbd_export. If the -c option is not specified, GNBD runs with a noticeable performance decrease. Also, if the -c option is not specified, the exported GNBD runs in timeout mode, using the default timeout value (the -t option). For more information about the gnbd_export command and its options, refer to the gnbd_export man page.
This example exports device /dev/sdb2 as GNBD delta with cache enabled.
gnbd_export -d /dev/sdb1 -e delta -c
The gnbd.ko kernel module must be loaded on a node before it can import GNBDs. When GNBDs are imported, device nodes are created for them in /dev/gnbd/ with the name assigned when they were exported.
gnbd_import -i Server
Specifies a GNBD server by hostname or IP address from which to import GNBDs. All GNBDs exported from the server are imported on the client running this command.
This example imports all GNBDs from the server named nodeA.
gnbd_import -i nodeA