美文网首页
使用autofs自动挂载cephfs(kernel mount)

使用autofs自动挂载cephfs(kernel mount)

作者: lnsyyj | 来源:发表于2022-11-15 14:49 被阅读0次

    autofs挂载ceph-fuse(kernel mount cephfs)

    安装autofs

    root@ceph-1:~# apt-get install -y autofs
    root@ceph-1:~# mkdir -p /cephfs/mds
    

    编译配置文件

    root@ceph-1:~# grep key /etc/ceph/ceph.client.admin.keyring  | cut -d= -f2-
     AQBr/HJjT9+QAhAAwPlUCQcitZwMeiw8O+Uzog==
    
    root@ceph-1:~# vim /etc/ceph/autofs-admin.keyring
    AQBr/HJjT9+QAhAAwPlUCQcitZwMeiw8O+Uzog==
    
    root@ceph-1:~/autofs# chmod 600 /etc/ceph/autofs-admin.keyring 
    
    root@ceph-1:~# vim /etc/auto.misc
    mds -fstype=ceph,name=admin,secretfile=/etc/ceph/autofs-admin.keyring,noatime 192.168.3.52:/
    
    root@ceph-1:~# vim /etc/auto.master 
    /cephfs /etc/auto.misc --timeout 60
    

    重启autofs服务

    root@ceph-1:~# systemctl restart autofs && systemctl enable autofs && systemctl status autofs
    

    测试自动挂载

    root@ceph-1:~# df -Th
    Filesystem     Type      Size  Used Avail Use% Mounted on
    udev           devtmpfs   63G     0   63G   0% /dev
    tmpfs          tmpfs      13G  1.6M   13G   1% /run
    /dev/sde2      ext4      458G   13G  423G   3% /
    tmpfs          tmpfs      63G   53M   63G   1% /dev/shm
    tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
    tmpfs          tmpfs      63G     0   63G   0% /sys/fs/cgroup
    tmpfs          tmpfs      13G     0   13G   0% /run/user/0
    root@ceph-1:~# ls /cephfs/mds/
    1
    root@ceph-1:~# df -Th
    Filesystem     Type      Size  Used Avail Use% Mounted on
    udev           devtmpfs   63G     0   63G   0% /dev
    tmpfs          tmpfs      13G  1.6M   13G   1% /run
    /dev/sde2      ext4      458G   13G  423G   3% /
    tmpfs          tmpfs      63G   53M   63G   1% /dev/shm
    tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
    tmpfs          tmpfs      63G     0   63G   0% /sys/fs/cgroup
    tmpfs          tmpfs      13G     0   13G   0% /run/user/0
    192.168.3.52:/ ceph      3.5T     0  3.5T   0% /cephfs/mds
    

    相关文章

      网友评论

          本文标题:使用autofs自动挂载cephfs(kernel mount)

          本文链接:https://www.haomeiwen.com/subject/nhtexdtx.html