rados命令操作指南
获取对象omap信息
[root@ceph-1 ~]# rados -p pool listomapvals rbd_header.111c2ae8944a features value (8 bytes) : 00000000 3d 00 00 00 00 00 00 00 |=.......| 00000008 object_prefix value (25 bytes) : 00000000 15 00 00 00 72 62 64 5f 64 61 74 61 2e 31 31 31 |....rbd_data.111| 00000010 63 32 61 65 38 39 34 34 61 |c2ae8944a| 00000019 order value (1 bytes) : 00000000 16 |.| 00000001 size value (8 bytes) : 00000000 00 00 40 00 00 00 00 00 |..@.....| 00000008 snap_seq value (8 bytes) : 00000000 0a 00 00 00 00 00 00 00 |........| 00000008 snapshot_000000000000000a value (81 bytes) : 00000000 04 01 4b 00 00 00 0a 00 00 00 00 00 00 00 04 00 |..K.............| 00000010 00 00 73 6e 61 70 00 00 40 00 00 00 00 00 3d 00 |..snap..@.....=.| 00000020 00 00 00 00 00 00 01 01 1c 00 00 00 ff ff ff ff |................| 00000030 ff ff ff ff 00 00 00 00 fe ff ff ff ff ff ff ff |................| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 |.| 00000051
获取对象的快照信息,代表对象已经被覆盖写,产生了快照文件
[root@ceph-1 ~]# rados -p pool listsnaps rbd_data.14a82ae8944a.0000000000000000 rbd_data.14a82ae8944a.0000000000000000: cloneid snaps size overlap 5 5 4194304 [] head - 4194304
获取对象所在的卷,id_*代表pool id
[root@ceph-1 ~]# rados -p pool listomapvals rbd_directory id_14a82ae8944a value (9 bytes) : 00000000 05 00 00 00 74 65 73 74 31 |....test1| 00000009 id_5f34238e1f29 value (8 bytes) : 00000000 04 00 00 00 74 65 73 74 |....test| 00000008 name_test value (16 bytes) : 00000000 0c 00 00 00 35 66 33 34 32 33 38 65 31 66 32 39 |....5f34238e1f29| 00000010 name_test1 value (16 bytes) : 00000000 0c 00 00 00 31 34 61 38 32 61 65 38 39 34 34 61 |....14a82ae8944a| 00000010
获取ceph对象文件的的扩展属性,如果对象文件扩展属性丢失,这ceph不会识别对象文件,需要创建对象文件属性,查看文件属性需要安装attr, yum install attr -y
[root@ceph-1 ~]# getfattr -d /var/lib/ceph/osd/ceph-0/current/4.31_head/rbd\\udata.5f34238e1f29.0000000000000000__head_594D79B1__4 getfattr: Removing leading '/' from absolute path names # file: var/lib/ceph/osd/ceph-0/current/4.31_head/rbd\134udata.5f34238e1f29.0000000000000000__head_594D79B1__4 user.ceph._=0sEAgfAQAABANHAAAAAAAAACYAAAByYmRfZGF0YS41ZjM0MjM4ZTFmMjkuMDAwMDAwMDAwMDAwMDAwMP7/////////sXlNWQAAAAAABAAAAAAAAAAGAxwAAAAEAAAAAAAAAP////8AAAAAAAAAAP//////////AAAAAF4AAAAAAAAAxAAAAF0AAAAAAAAAxAAAAAICFQAAAAj5FgAAAAAAABAAAAAAAAAAAAAAAAAAQAAAAAAAD4B7YuToTR8CAhUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABeAAAAAAAAAAAAAAAAAA== user.ceph._@1=0sAAAANAAAAA+Ae2IeUy4gjaIELv////8AAAAAAAAAAAAAAAAAAAAAAAAAAA== user.ceph.snapset=0sAgIxAAAABAAAAAAAAAABAQAAAAQAAAAAAAAAAAAAAAAAAAABAAAABAAAAAAAAAAAAAAAAAAAAA== user.cephos.spill_out=0sMAA=