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

将挂载信息写入/etc/fstab文件中

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

文章插图
提示:使用fuse方式挂载cephfs,对应文件系统设备为none,类型为fuse.ceph;挂载选项里只需要指定用ceph.id(ceph授权的用户名,不要前缀client),ceph配置文件路径;这里不需要指定密钥文件,因为ceph.id指定的用户名,ceph-fuse会自动到/etc/ceph/目录下找对应文件名的keyring文件来当作对应用户名的密钥文件;
测试,使用fstab配置文件,看看是否可正常挂载?
[root@ceph-admin ~]# dfFilesystem              1K-blocks    Used Available Use% Mounted ondevtmpfs                   919632       0    919632   0% /devtmpfs                      931496       0    931496   0% /dev/shmtmpfs                      931496    9744    921752   2% /runtmpfs                      931496       0    931496   0% /sys/fs/cgroup/dev/mapper/centos-root  50827012 3718492  47108520   8% //dev/sda1                  520868  179572    341296  35% /boottmpfs                      186300       0    186300   0% /run/user/0[root@ceph-admin ~]# ll /mnttotal 0[root@ceph-admin ~]# mount -aceph-fuse[8770]: starting ceph client2022-10-06 23:25:57.230 7ff21e3f7c00 -1 init, newargv = 0x5614f1bad9d0 newargc=9ceph-fuse[8770]: starting fuse[root@ceph-admin ~]# mount |tail -2fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)ceph-fuse on /mnt type fuse.ceph-fuse (rw,relatime,user_id=0,group_id=0,allow_other)[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 ~]# 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 ~]#

经验总结扩展阅读