美文网首页
ceph设计原理与实现(CRUSH算法)

ceph设计原理与实现(CRUSH算法)

作者: SkTj | 来源:发表于2019-03-02 15:55 被阅读9次

    1、ceph架构


    image.png

    2、CRUSH基于哈希的数据分布算法


    image.png
    3、straw算法straw2算法
    image.png

    straw2在新osd加入时不会引起其他osd的迁移
    4、CRUSH计算的输入为X, cluster map ,placement rule
    5、cluster map:
    device 磁盘 /主机 bucket /数据中心 root


    image.png
    image.png
    image.png
    6、placement rule:
    take/select :firstn indep /emit
    7、选择Jewel版本之后
    8、针对CRUSH算法的可调整配置,不建议更改
    image.png

    9、CRUSH配置的模板,JEWEL版本?


    image.png
    10、crush map
    获取:ceph osd getcrushmap -o file
    手动生成crush map:27个osd,3个host,rack 3,root 0
    image.png
    将上述输出的文件反编译成可读文件:crushtool -d file -o file.txt
    查看:vi file.txt
    placement rule参数解析:
    ruleset 不同pool不同编号
    type : replicated/erasure
    min_size/max_size
    step:take /chooseleaf /emit
    step chooseleaf firstn 0 type host:chooseleaf容灾模式,firstn/ndep,容灾级别:type host/rack
    take 可以限制选择root/rack1 2 3 /bucket
    编译:crushtool -c file.txt -o file
    注入集群:ceph osd setcrushmap -i file
    测试:crushtool -i mycrushmap --test --mix-x 9 --num-rep 3 --ruleset 0 --show_mappngs
    12、查看空间利用率:ceph osd df tree
    调整osd的权重:ceph osd reweight osdid reweight
    image.png
    13、批量调整reweight

    ceph osd reweight-by-utilization 105 .2 4 --no-increasing


    image.png
    14、

    相关文章

      网友评论

          本文标题:ceph设计原理与实现(CRUSH算法)

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