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

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:

  1. 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.

  2. 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

  3. 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} under Export locations when you click on the share in the Shares screen or the output of the openstack 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

  4. Run the mount ${mountPoint} command to mount CephFS share and df -h ${mountPoint} to verify the CephFS share is mounted successfully.