美文网首页
[Ceph] BlueStore 对象操作

[Ceph] BlueStore 对象操作

作者: AustinPup | 来源:发表于2019-01-17 11:15 被阅读0次
    1. Bluestore 概述


      bluestore.png

    Bluestore直接管理裸设备,抛弃了ext4/xfs等本地文件系统,BlockDevice实现在用户态下使用linux aio直接对裸设备进行I/O操作。

    BlueStore: 数据存储,对应的就是Allocator,目前支持StupidAllocator和BitmapAllocator两种分配器。

    BlueFS: 元数据以kv的形式保存到kv数据库里,默认使用的是rocksdb,由于rocksdb本身是基于文件系统的,不是直接操作裸设备,实现了一个小的文件系统BlueFS,在系统启动mount这个文件系统的时候将所有的元数据都加载到内存中.

    BlueFS和BlueStore可以共享裸设备,也可以分别指定不同的设备

    1. 卸载,删除image
      rbd showmapped
      rbd unmap /dev/rbd0
      rbd rm pool/image2

    3 查看object
    rados -p rbd ls

    4 #可以查看PG映射OSD的集合,即PG具体分配到OSD的归属。第二个是以poolid为1的开始值
    ceph pg dump | grep ^1. | awk '{print 1 "\t"17}' | more

    5 对象存储工具-ra#
    == 扫描存储明细
    rados df

    ==池扫描
    rados lspools

    ==扫描池中的所有对象
    rados -p rbd ls

    == 对象:写入、获取、删除
    rados -p rbd put ot1 testfile.txt
    rados -p rbd get ot1 ot1
    rados -p rbd rm ot1

    1G文件

    dd if=/dev/zero of=test bs=1M count=1000

    == 对象属性:写入时间
    rados -p rbd stat2 ot1

    == 对象属性扫描、设置、获取
    rados -p rbd listxattr ot1
    rados -p rbd setxattr ot1 type txt
    rados -p rbd getxattr ot1 type

    === 对象PG路径:
    ceph osd map rbd ot1
    ceph pg dump | grep ^1.64

    6 重启mon
    systemctl restart ceph-mon.target

    7 重启osd
    systemctl restart ceph-osd@1

    6 PG信息
    http://blog.51cto.com/zhanguo1110/1543032

    详细

    ceph pg dump

    部署明细

    ceph pg map 1.5f

    状态

    ceph pg stat

    单个明细

    ceph pg 1.5f query

    PG_STAT 1.64
    OBJECTS 1
    MISSING_ON_PRIMARY 0
    DEGRADED 0
    MISPLACED 0
    UNFOUND 0
    BYTES 6291456
    LOG 73
    DISK_LOG 73
    STATE active+clean
    STATE_STAMP 2019-01-15 20:10:43.445001
    VERSION REPORTED
    UP
    UP_PRIMARY
    ACTING
    ACTING_PRIMARY
    LAST_SCRUB
    SCRUB_STAMP
    LAST_DEEP_SCRUB DEEP_SC
    RUB_STAMP SNAPTRIMQ_LEN

    /sys/class/block
    find / -name 'ceph'

    相关文章

      网友评论

          本文标题:[Ceph] BlueStore 对象操作

          本文链接:https://www.haomeiwen.com/subject/oxobdqtx.html