[root@mytest ~]# rbd create test1 --size 4000
[root@mytest ~]# rbd info test1
rbd image 'test1':
size 4000 MB in 1000 objects
order 22 (4096 kB objects)
block_name_prefix: rb.0.fa6c.6b8b4567
format: 1
可以看出是没写入真实数据的
[root@mytest ~]# ceph df|grep rbd
rbd 0 133 0 30627M 2
[root@mytest ~]# rados ls -p rbd
test1.rbd
rbd_directory
查看下这两个对象的内容
[root@mytest ~]#rados -p rbd get test1.rbd test1rbd.txt
[root@mytest ~]# echo -e `cat test1rbd.txt`
<<< Rados Block Device Image >>> rb.0.fa6c.6b8b4567RBD001.005
这个是记录的rbd镜像的信息
[root@mytest ~]# rados -p rbd get rbd_directory rbddirectory.txt
[root@mytest ~]# echo -e `cat rbddirectory.txt`
test1
这个是记录的rbd的目录信息
[root@mytest ~]# rbd map test1
/dev/rbd0
[root@mytest ~]# mkfs.xfs /dev/rbd/rbd/test1
log stripe unit (4194304 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/rbd/rbd/test1 isize=256 agcount=9, agsize=126976 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=1024000, imaxpct=25
= sunit=1024 swidth=1024 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@mytest mnt]# rados -p rbd ls
rb.0.fa6c.6b8b4567.0000000001f0
rb.0.fa6c.6b8b4567.0000000001f1
rb.0.fa6c.6b8b4567.000000000174
test1.rbd
rb.0.fa6c.6b8b4567.0000000002e8
rb.0.fa6c.6b8b4567.0000000001f2
rbd_directory
rb.0.fa6c.6b8b4567.0000000000f8
rb.0.fa6c.6b8b4567.0000000003e0
rb.0.fa6c.6b8b4567.000000000000
rb.0.fa6c.6b8b4567.00000000007c
rb.0.fa6c.6b8b4567.0000000003e7
rb.0.fa6c.6b8b4567.00000000026c
rb.0.fa6c.6b8b4567.000000000001
rb.0.fa6c.6b8b4567.000000000364
可以看到格式化过程中写入了一些对象信息,这些应该是存储文件系统信息的,写入的对象,数据的写入的前缀是rb.0.fa6c.6b8b4567
[root@mytest 0.1_head]# ceph osd map rbd rb.0.fa6c.6b8b4567.0000000001f0
osdmap e78 pool 'rbd' (0) object 'rb.0.fa6c.6b8b4567.0000000001f0' -> pg 0.1cdfe181 (0.1) -> up ([1], p1) acting ([1], p1)
可以查看到数据是在节点1的pg 0.1 里面
[root@mytest 0.1_head]# ll /var/lib/ceph/osd/ceph-1/current/0.1_head/
total 4100
-rw-r--r-- 1 root root 0 Aug 10 14:02 __head_00000001__0
-rw-r--r-- 1 root root 4194304 Aug 23 12:36 rb.0.fa6c.6b8b4567.0000000001f0__head_1CDFE181__0
可以看到这个对象
上面的步骤实现的是:
无法实现的是查询文件系统之上的某个文件在哪里,这个在cephfs 文件系统接口中是有的
手机扫一扫
移动阅读更方便
你可能感兴趣的文章