环境:centos7.6, ceph luminious
ceph 同时提供对象存储、块存储、文件存储三种接口,但本质上都是对象存储,也就是说一个rbd image 实际上包含了多个对象(默认情况下是 iamge_size/4M)
查看 pg 对应的 osd
ceph pg dump
ceph pg map 3.5d
查看 pool 中的 image
[root@ansible002 ~]# rbd list k8s
kubernetes-dynamic-pvc-0f4455a2-f96a-11e9-993f-0651fdcbf014
查看 pool 中的对象
[root@ansible002 ~]# rados -p k8s ls
...
rbd_data.1fdd5b6b8b4567.00000000000015cc
查看 object 对应的 pg 和 osd
[root@ansible002 ~]# ceph osd map k8s rbd_data.1fdd5b6b8b4567.00000000000015cc
osdmap e1699 pool 'k8s' (12) object 'rbd_data.1fdd5b6b8b4567.00000000000015cc' -> pg 12.fa09ffff (12.3ff) -> up ([13], p13) acting ([13], p13)
查看 rbd image 的指纹信息 block_name_prefix
[root@ansible002 ~]# rbd info k8s/kubernetes-dynamic-pvc-0f4455a2-f96a-11e9-993f-0651fdcbf014
rbd image 'kubernetes-dynamic-pvc-0f4455a2-f96a-11e9-993f-0651fdcbf014':
size 100GiB in 25600 objects
order 22 (4MiB objects)
block_name_prefix: rbd_data.267ef46b8b4567
format: 2
features: layering
flags:
create_timestamp: Mon Oct 28 18:02:46 2019
找到 rbd_data.267ef46b8b456 对应的 object(一般为多个)
[root@ansible002 ~]# rados -p k8s ls | grep rbd_data.267ef46b8b4567
rbd_data.267ef46b8b4567.0000000000002443
rbd_data.267ef46b8b4567.000000000000003d
rbd_data.267ef46b8b4567.0000000000000079
...