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