Attach a volume to a cluster machine
Learn how to attach your volume to a cluster machine and mount it
Attach a volume to a cluster machine
To attach a volume to a cluster machine, you will need to have an existing volume and a cluster machine. If you do not have a volume, you can create a volume, if you do not have a cluster, you can create a cluster.
Once you have both a volume and a cluster, follow these steps to attach the volume to a cluster machine:
- Navigate to the project you wish to attach a volume to.
- Navigate to "Clusters" from the side navigation.
- Click on the cluster you wish to attach the volume to.
- Click on the dropdown next to the cluster machine you wish to attach the volume to.
- Click on "Attach volume".
- Select the volume you wish to attach from the dropdown.
- Click "Attach volume".
This will ensure that the volume is available to the cluster machine and can be mounted.
Mounting the volume
Once the volume is attached to the cluster machine, you will need to mount it to use it. You can do this by SSHing into the cluster machine and following these steps:
Make sure the instance has the necessary Network File System dependency installed.
sudo apt install nfs-common
Create a directory on the system where you will mount your storage volume.
sudo mkdir /data
Add the configuration for your networked storage connection to the File System Table (/etc/fstab
). You need to point the configuration to the storage volume's IP.
You can find this IP in the volumes list page.
<storage vip>:/data /data nfs rw,nconnect=16,nfsvers=3 0 0
Once you have updated the configuration in /etc/fstab
run the following command to mount the volume.
sudo mount -a
To confirm that the volume mounted correctly, run the following command and make sure you see your target drive (/data
) has been successfully connected to your storage volume's IP.
df -h
Unmounting the volume
You may want to a volume from a cluster machine if you are swapping out the attached storage volume (prior to attaching and mounting the new volume), or perhaps you are done using the volume and have terminated it.
Simply run the umount command on the mount drive to unmount the volume.
sudo umount /data
Make sure to remove any configuration for storage volume previously added to the File System Table (/etc/fstab
).