Access Shares
This document describes how to access a CephFS share in Red Cloud 2. A CephFS share can be accessed by Red Cloud 2 instances or any virtual or physical hosts on Cornell campus network.
Prerequisites
- A CephFS share in Red Cloud: If you have a Red Cloud subscription, you can follow these instructions to create a CephFS share in Horizon Web Console or using OpenStack CLI client.
- A Cephx key with either read-only or read-write access to the CephFS share: If you are the owner of the CephFS share, you can
- Find existing Cephx or share rules using Horizon Web Console or Openstack CLI client.
- Create a Cephx key by adding a share rule using Horizon Web Console or Openstack CLI client.
- A client host running an operating system supported by CephFS.
Install CephFS Client
The official Red Cloud Rocky and Ubuntu Linux images include CephFS client. You can skip to the configuration section if the client is a Red Cloud instance created from an official Rocky or Ubuntu Linux image.
-
Rocky Linux:
dnf -y install epel-release centos-release-ceph-reef
dnf -y install python3-cephfs ceph-common
-
Ubuntu Linux:
apt install ceph-common
Configure CephFS Client
As the root
user on the client:
-
Create the
/etc/ceph/ceph.client.${accessTo}.keyring
keyring file with access key like this:[client.${accessTo}] key = ${accessKey}
where
${accessTo}
and${accessKey}
are the "Acess To" and "Access Key" fields of the share rule. -
Make the
/etc/ceph/ceph.client.${accessTo}.keyring
keyring file readable only to root:chown root:root /etc/ceph/ceph.client.${accessTo}.keyring chmod 0600 /etc/ceph/ceph.client.${accessTo}.keyring
-
Add the following line to
/etc/fstab
:${path} ${mountPoint} ceph name=${accessTo},x-systemd.device-timeout=30,x-systemd.mount-timeout=30,noatime,_netdev,rw 0 2
You can find the value for
${path}
underExport locations
when you click on the share in the Shares screen or the output of theopenstack share show -c export_locations <share name>
command.${mountPoint}
specifies where you want CephFS to be mounted on your client.For example:
128.84.20.11:6789,128.84.20.12:6789,128.84.20.15:6789,128.84.20.13:6789,128.84.20.14:6789:/volumes/_nogroup/fe4f8ad4-2877-4e23-b5d3-46eb8476750b/ab404bac-9584-45f4-8a34-92dfc61fbb98 /cephfs ceph name=smithlabRWaccess,x-systemd.device-timeout=30,x-systemd.mount-timeout=30,noatime,_netdev,rw 0 2
-
Run the
mount ${mountPoint}
command to mount CephFS share anddf -h ${mountPoint}
to verify the CephFS share is mounted successfully.