ceph(luminous)-Bluestore,查看对象信息

  • 本文主要介绍了通过ceph-objectstore-tool和ceph-dencoder友好的展示出存储池对象中的一些基本信息.

由于bluestore中已经看不到filestore那样的目录结构了,所以文件系统的attr也不可见了,只能通过objectstore-tool把attr属性从db中导出来,然后再通过dencoder解码,才能看到.

  1. 确定对象所在osd(ceph osd map ),停止对应osd(可以通过osd set noout防止迁移).
  2. 通过ceph-objectstore-tool 列出对象的属性.
[root@node01 cephtools]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0/ --type bluestore rbd_data.81.a8c6bd6b8b4567.0000000000003249 list-attrs
_                 //"_为对象的attr属性"
hinfo_key
snapset

  1. 把对象属性导出为一个文件.
[root@node01 cephtools]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0/ --type bluestore rbd_data.81.a8c6bd6b8b4567.0000000000003249 get-attr hinfo_key > /home/yg/cephtools/attrhinfo_key.dat
[root@node01 cephtools]# ll
total 8
-rw-r--r-- 1 root root 298 Oct 10 14:39 attr_.dat
-rw-r--r-- 1 root root  18 Oct 10 14:40 attrhinfo_key.dat
  1. 利用ceph-dencoder解码二进制属性
[root@node01 cephtools]# ceph-dencoder import attr_.dat type object_info_t decode dump_json   //type属性通过ceph-dencoder list_types查看
{
    "oid": {
        "oid": "rbd_data.81.a8c6bd6b8b4567.0000000000003249",
        "key": "",
        "snapid": -2,
        "hash": 1909457131,
        "max": 0,
        "pool": 83,
        "namespace": ""
    },
    "version": "22364'14561",
    "prior_version": "22364'13751",
    "last_reqid": "client.78400726.0:4897",
    "user_version": 14561,
    "size": 4194304,
    "mtime": "2018-09-28 16:22:27.698045",
    "local_mtime": "2018-09-28 16:22:27.698351",
    "lost": 0,
    "flags": [
        "dirty"
    ],
    "legacy_snaps": [],
    "truncate_seq": 0,
    "truncate_size": 0,
    "data_digest": "0xffffffff",
    "omap_digest": "0xffffffff",
    "expected_object_size": 4194304,
    "expected_write_size": 4194304,
    "alloc_hint_flags": 0,
    "manifest": {
        "type": 0,
        "redirect_target": {
            "oid": "",
            "key": "",
            "snapid": 0,
            "hash": 0,
            "max": 0,
            "pool": -9223372036854775808,
            "namespace": ""
        }
    },
    "watchers": {}
}
[root@node01 cephtools]# ceph-dencoder import attrhinfo_key.dat type ECUtil::HashInfo decode dump_json
{
    "total_chunk_size": 2097152,
    "cumulative_shard_hashes": []
}

你可能感兴趣的:(ceph,ceph,bluestore)