CephFS功能测试

1. mds部署

使用ceph-deploy部署ceph mds很方便,只需要简单的一条命令就搞定,不过它依赖之前ceph-deploy时候生成的一些配置和keyring文件。

在之前部署ceph集群的节点目录,执行ceph-deploy mds create:

ceph-deploy mds create ceph8019
#去节点检查下daemon
ps aux | grep ceph-mds

2. 创建CephFS

#创建metadata pool
ceph osd pool create cephfs_metadata 8 8  replicated  hdd
#创建data pool
ceph osd pool create cephfs_data_hdd 8 8 replicated  hdd
#创建cephfs
ceph fs new cephfs cephfs_metadata cephfs_data_hdd
#查看文件系统状态
ceph fs ls
#查看mds状态
ceph mds stat

3. 在测试节点mount上CephFS

内核态挂载方式:

#secret信息在/etc/ceph/ceph.client.{user_id}.keyring
sudo mount -t ceph -o name=admin,secret=AQAS6OtgaeQ7DhAAEqJn1eeUvELiiSLk4U/Dmg== 10.65.102.115:6789:/ /home/ceph/cephfs/

4. 查看CephFS状态

ceph fs get cephfs

在这里插入图片描述

5. CephFS功能测试

测试常见的文件系统操作

5.1 创建测试dir和file

cd /home/ceph/cephfs/
mkdir testdir
cd testdir
touch testfile
ls

在这里插入图片描述

5.2 测试file的读写

echo "hello cephfs" > testfile
cat testfile

在这里插入图片描述

5.3 测试file的chmod

ll testfile
chmod 755 testfile
ll testfile

在这里插入图片描述

5.4 测试file的chown

ll testfile
chown ceph:ceph testfile
ll testfile

在这里插入图片描述

5.5 测试file的symlink

ln -s testfile lnfile
ll lnfile

在这里插入图片描述

5.6 删除测试dir和file

ls
rm -f testfile
ls
cd ../
ls
rm -rf testdir/
ls

在这里插入图片描述

6. 删除CephFS

6.1 停止ceph mds服务

#在机器上停止ceph mds服务,操作需要验证
systemctl stop ceph-mds.target
#查看服务状态
systemctl status ceph-mds.target

在这里插入图片描述

6.2 删除cephfs

#删除cephfs,需要加 --yes-i-really-mean-it参数,不加会报错
ceph fs rm cephfs --yes-i-really-mean-it

在这里插入图片描述

6.3 删除cephfs使用的pool

#删除cephfs使用的pool,需要把pool名字写两次,并且加 --yes-i-really-mean-it参数,不然会报错
ceph osd pool delete cephfs_metadata cephfs_metadata --yes-i-really-really-mean-it
ceph osd pool delete cephfs_data_hdd cephfs_data_hdd --yes-i-really-really-mean-it

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值