场景: 我已经使用proxmox配置了ceph集群,但是从proxmox外部(例如台式机)访问它时遇到了一些麻烦。 我可以在所有文件和文件夹上具有以下权限来装载和查看文件夹和文件(我可以通过目录进出浏览): drwxr-xr-x
主要问题是我看不到文件内容(文件的full_path头出现错误)
head: error reading '/mnt/ftd/data/file1.bin': Operation not permitted
跟踪错误:
openat(AT_FDCWD,"/mnt/ftd/data/file.bin",O_RDONLY) = 3
read(3,0x7ffd679877b0,8192) = -1 EPERM (Operation not permitted)
fstab:
ceph-mon1.storage:6789:/data /mnt/ftd ceph name=cephx,secretfile=/etc/ceph/ceph.client.cephx.keyring,ro,_netdev,noatime 0 0
使用管理员及其主要工作原理
客户端权限生成:
#on client,outside of proxmox (desktop)
sudo su
apt-get install ceph-common
mkdir /etc/ceph
ssh ceph-mon1.storage
ssh root@ceph-mon1.storage "ceph config generate-minimal-conf" | tee /etc/ceph/ceph.conf
chmod 644 /etc/ceph/ceph.conf
ssh root@ceph-mon1.storage " ceph fs authorize cephfs-data client.cephx / rw" | tee /etc/ceph/ceph.client.cephx.keyring
chmod 600 /etc/ceph/ceph.client.cephx.keyring
#edit ceph.client.cephx.keyring to contain only key
版本:
- 服务器ceph版本12.2.11
- 客户端ceph版本12.2.12
ceph身份验证列表:
client.admin
key: <<<key deleted >>>
caps: [mds] allow *
caps: [mgr] allow *
caps: [mon] allow *
caps: [osd] allow *
client.cephx
key: <<<key deleted but exist in actual file>>>
caps: [mds] allow rw
caps: [mon] allow r
caps: [osd] allow rw tag cephfs data=cephfs-data
在管理员权限下工作