为ceph开启CephFS挂载

环境信息

  • OS –> CentOS7.5-1804
  • Ceph –> 10.2.10

安装前确定集群状态是正常的

ceph -s
    cluster 3445bd7a-55d1-4b0c-9ba6-5b16a29f6dad
     health HEALTH_OK
     monmap e1: 5 mons at {ceph-1=192.168.1.51:6789/0,ceph-2=192.168.1.52:6789/0,ceph-3=192.168.1.53:6789/0,ceph-4=192.168.1.54:6789/0,ceph-5=192.168.1.55:6789/0}
            election epoch 10, quorum 0,1,2,3,4 ceph-1,ceph-2,ceph-3,ceph-4,ceph-5
      fsmap e7: 1/1/1 up {0=ceph-1=up:active}, 2 up:standby
     osdmap e141: 10 osds: 10 up, 10 in
            flags sortbitwise,require_jewel_osds
      pgmap v357: 320 pgs, 4 pools, 2558 bytes data, 20 objects
            51552 MB used, 249 GB / 299 GB avail
                 320 active+clean

检查元数据服务是否创建

ceph mds stat

如下则为正常

e7: 1/1/1 up {0=ceph-1=up:active}, 2 up:standby

全为0的话,则添加mds节点

ceph-deploy mds create ceph-1 ceph-2 ceph-3

创建cephfs文件系统

ceph osd pool create cephfs_data 64
ceph osd pool create cephfs_metadata 64
ceph fs new cephfs cephfs_metadata cephfs_data

挂载

mkdir /mnt/cephfs
mount.ceph ceph-3,ceph-2,ceph-1:/ /mnt/cephfs/ -o name=admin,secret=AQAzCfRadRzIDhAAATbRfsO6kOhqDKKPejrRnw==

secret在/etc/ceph/ceph.client.admin.keyring可以查到
验证

df -h
[root@ceph-1 ~]# df -h
Filesystem                                Size  Used Avail Use% Mounted on
/dev/mapper/centos-root                    17G  1.4G   16G   9% /
devtmpfs                                  3.9G     0  3.9G   0% /dev
tmpfs                                     3.9G     0  3.9G   0% /dev/shm
tmpfs                                     3.9G  8.7M  3.9G   1% /run
tmpfs                                     3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/vda1                                1014M  180M  835M  18% /boot
tmpfs                                     783M     0  783M   0% /run/user/0
/dev/vdb1                                  30G  5.1G   25G  17% /data/osd0
/dev/vdc1                                  30G  5.1G   25G  17% /data/osd1
192.168.1.53,192.168.1.52,192.168.1.51:/  300G   51G  250G  17% /mnt/cephfs

可能出现的错误
1.mount error 5 = Input/output error
2. mount error 22 = Invalid argument
第一个,首先先查mds服务是正常,不存在则添加
第二个,密钥不正确,检查密钥

你可能感兴趣的:(为ceph开启CephFS挂载)