CephFS Kernel Mount using Secretfile
Description:
This guide will show you how to mount a cephfs filesystem on a linux client using the kernel driver and secret file.
Prerequisites:
- A running Ceph Cluster
- CephFS filesystem running on a Ceph Cluster
- The IP or host-name of one or more Ceph monitors
- Access to a linux client system that is able to connect to the Ceph Cluster through a network
Steps:
1. Install required packages and dependencies on the linux client system
The only package required on the client is the ceph-common package and dependencies
For CentOS 7:
cat <<EOF > /etc/yum.repos.d/ceph_stable.repo
[ceph_stable]
baseurl = http://download.ceph.com/rpm-nautilus/el7/$basearch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable $basearch repo
priority = 2
[ceph_stable_noarch]
baseurl = http://download.ceph.com/rpm-nautilus/el7/noarch
gpgcheck = 1
gpgkey = https://download.ceph.com/keys/release.asc
name = Ceph Stable noarch repo
priority = 2
EOF
yum install ceph-common
2. Determine the location you wish to mount your ceph filesystem on the linux client and create the proper path:
mkdir /mnt/mycephmount
3. To authenticate, copy secret-client-admin-keyring to client system in secret file
On any ceph monitor system:
Create client user admin keyring:
ceph auth get-key client.admin > admin.secret
Copy it to the client machine
scp admin.secret clientIP:/etc/ceph/
On client system:
Ensure the permissions are set appropriately for the file most likely:
chmod 600 /etc/ceph/admin.secret
4. Mounting filesystem
Kernel Driver Mount:
Create location to mount CephFS:
mkdir /mnt/mycephfsmount
Mount the filesystem:
mount -t ceph {ip-address-of-ceph-monitor}:/ /mnt/mycephfsmount -o name=admin,secretfile=/etc/ceph/admin.secret