Network File System (NFS)
September 6, 2024 ยท View on GitHub
NFS is used as an abstraction layer to allow users to work naturally across file systems. In a cluster setup working across file systems is really important when multiple nodes work on the same data.
Most BiBiGrid users will never really interact consciously with BiBiGrid's underlying NFS, but simply use it.
How To Configure NFS Shares?
When starting an ansible cluster, at least /vol/spool is initialised as an NFS share if the key
nfs is True.
Further NFS shares can then be configured using configuration's
nfsshares key.
Manually Creating NFS Shares
We discourage bypassing BiBiGrid's configuration by creating additional NFS shares manually, because they will not be automatically registered by scheduled workers.
Useful Commands
| Summary | Command | Explanation & Comment |
|---|---|---|
| List all nfs shares | showmount --exports |
NFS commands
See nfs' manpage.
How To Share an Attached Volume
By mounting a volume into a shared directory, volumes can be shared.
Configuration
Let's assume our configuration holds (among others) the keys:
nfs: True
masterMounts:
- testMount
nfsShares:
- testShare
Where testMount is an existing, formatted volume with a filesystem type (for example: ext4, ext3, ntfs, ...).
During cluster creation...
-
BiBiGrid sets up the nfsShare
/testShare. -
BiBiGrid attached the volume
testMountto our master instance. The volume is not mounted yet. -
We call the cluster
bibigrid-master-ournfsclusteridin the following.
Mounting a Volume Into a Shared Directory
In order to mount a volume into a shared directory, we first need to identify where our volume was attached.
Find Where Volume Has Been Attached
Executing this openstack client command will give us a list of volumes. Most likely it is best run from your local machine.
openstack volume list --os-cloud=openstack
Result:
| ID | Name | Status | Size | Attached to |
|---|---|---|---|---|
| 42424242-4242-4242-4242-424242424242 | notTestVolume | available | X | |
| 42424242-4242-4242-4242-424242424221 | testMount | in-use | Y | Attached to bibigrid-master-ournfsclusterid on /dev/vdd |
As you can see, the volume testMount was attached to /dev/vdd.
We can double-check whether /dev/vdd really exists by executing lsblk or lsblk | grep /dev/vdd on the master.
Mount Volume into Share
As our NFS share is /testShare, we now need to mount dev/vdd into testShare:
sudo mount -t auto /dev/vdd /testShare
The volume testMount is now successfully shared using NFS.
Workers can access the volume now by using /testShare, too.