分布式存储系统之Ceph集群CephFS基础使用( 六 )

挂载CephFS
[root@ceph-admin ~]# ceph-fuse -n client.fsclient -m ceph-mon01:6789,ceph-mon02:6789,ceph-mon03:6789 /mnt2022-10-06 23:13:17.185 7fae97fbec00 -1 auth: unable to find a keyring on /etc/ceph/ceph.client.fsclient.keyring,/etc/ceph/ceph.keyring,/etc/ceph/keyring,/etc/ceph/keyring.bin,: (2) No such file or directory2022-10-06 23:13:17.185 7fae97fbec00 -1 monclient: ERROR: missing keyring, cannot use cephx for authenticationfailed to fetch mon config (--no-mon-config to skip)[root@ceph-admin ~]#提示:这里提示我们在/etc/ceph/目录下没有找到对应用户的keyring文件;
导出client.fsclient用户密钥信息,并存放在/etc/ceph下取名为ceph.client.fsclient.keyring;
[root@ceph-admin ~]# ceph auth get client.fsclient -o /etc/ceph/ceph.client.fsclient.keyringexported keyring for client.fsclient[root@ceph-admin ~]# cat /etc/ceph/ceph.client.fsclient.keyring[client.fsclient]        key = AQDx2z5jgeqiIRAAIxQFz09BF99kcAYxiFwOWg==        caps mds = "allow rw"        caps mon = "allow r"        caps osd = "allow rw pool=cephfs-datapool"[root@ceph-admin ~]#再次使用ceph-fuse挂载cephfs
[root@ceph-admin ~]# ceph-fuse -n client.fsclient -m ceph-mon01:6789,ceph-mon02:6789,ceph-mon03:6789 /mnt2022-10-06 23:16:43.066 7fd51d9c0c00 -1 init, newargv = 0x55f0016ebd40 newargc=7ceph-fuse[8096]: starting ceph clientceph-fuse[8096]: starting fuse[root@ceph-admin ~]# df -hFilesystem               Size  Used Avail Use% Mounted ondevtmpfs                 899M     0  899M   0% /devtmpfs                    910M     0  910M   0% /dev/shmtmpfs                    910M  9.6M  901M   2% /runtmpfs                    910M     0  910M   0% /sys/fs/cgroup/dev/mapper/centos-root   49G  3.6G   45G   8% //dev/sda1                509M  176M  334M  35% /boottmpfs                    182M     0  182M   0% /run/user/0ceph-fuse                281G  4.0M  281G   1% /mnt[root@ceph-admin ~]# ll /mnttotal 3392-rw-r--r-- 1 root root 961243 Oct  6 22:17 day.jpg-rw-r--r-- 1 root root 961243 Oct  6 22:17 default.jpg-rw-r--r-- 1 root root 980265 Oct  6 22:17 morning.jpg-rw-r--r-- 1 root root 569714 Oct  6 22:17 night.jpg[root@ceph-admin ~]#

经验总结扩展阅读