• ceph crush 改正默认写入全部硬盘


     
    ceph crush 改正默认写入全部硬盘
    高德置地--------王锦雄
     
    一、ceph crush 策略配置
    1 获取crushmap二进制文件
    ceph osd getcrushmap -o a.map
    2 将二进制文件转成文本文件
    crushtool -d a.map -o b
    3 修改rules
    vi b
    二 测试数据是否写到ssd盘。
    1 查看osd情况
    [root@ceph1 ~]# ceph osd tree
    ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
    -1 0.76163 root default
    -9 0.25388 rack rack01
    -3 0.25388 host ceph1
    0 hdd 0.07809 osd.0 up 1.00000 1.00000
    1 hdd 0.07809 osd.1 up 1.00000 1.00000
    6 ssd 0.09769 osd.6 up 1.00000 1.00000
    -10 0.25388 rack rack02
    -5 0.25388 host ceph2
    2 hdd 0.07809 osd.2 up 1.00000 1.00000
    3 hdd 0.07809 osd.3 up 1.00000 1.00000
    7 ssd 0.09769 osd.7 up 1.00000 1.00000
    -11 0.25388 rack rack03
    -7 0.25388 host ceph3
    4 hdd 0.07809 osd.4 up 1.00000 1.00000
    5 hdd 0.07809 osd.5 up 1.00000 1.00000
    8 ssd 0.09769 osd.8 up 1.00000 1.00000
    查看class情况
    [root@ceph1 ~]# ceph osd crush class ls
    [
    "hdd",
    "ssd"
    ]
    第一步的反编译文件b显示rule内容:
    # rules
    rule replicated_rule {
    id 0
    type replicated
    min_size 1
    max_size 10
    step take default
    step chooseleaf firstn 0 type host
    step emit
    }
    rule rule-ssd {
    id 1
    type replicated
    min_size 1
    max_size 10
    step take default class ssd
    step chooseleaf firstn 0 type host
    step emit
    }
    2 找一个volumes rbd盘进行测试
    [root@ceph1 ~]# rbd -p volumes ls | grep 9709dd70
    volume-9709dd70-1c4e-40e1-85ff-37aa0015f0f1
    查看该9709dd70盘的详细信息:
    [root@ceph1 ~]# rbd info volumes/volume-9709dd70-1c4e-40e1-85ff-37aa0015f0f1
    rbd image 'volume-9709dd70-1c4e-40e1-85ff-37aa0015f0f1':
    size 1GiB in 256 objects
    order 22 (4MiB objects)
    block_name_prefix: rbd_data.1b8772238e1f29
    format: 2
    features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
    flags:
    create_timestamp: Sat Apr 18 22:30:43 2020
    截取对象编号:1b8772238e1f29
    3 查看1b8772238e1f29盘写入osd的信息导出到9709dd70.txt
    [root@ceph1 ~]# for i in `rados -p volumes ls | grep 1b8772238e1f29 | awk -F '.' '{print $3}'`; do ceph osd map volumes $i >> 9709dd70.txt; done
    9709dd70.txt的内容如下:
    [root@ceph1 ~]# cat 9709dd70.txt
    osdmap e547 pool 'volumes' (1) object '000000000000009e' -> pg 1.690c073a (1.3a) -> up ([4,7,1], p4) acting ([4,7,1], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000fc' -> pg 1.7773488d (1.d) -> up ([4,1,7], p4) acting ([4,1,7], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000086' -> pg 1.4f695e1a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000003e' -> pg 1.4430cc36 (1.36) -> up ([7,0,8], p7) acting ([7,0,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000c8' -> pg 1.9eeaa646 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000010' -> pg 1.b25a3a00 (1.0) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000060' -> pg 1.b7122e4d (1.d) -> up ([4,1,7], p4) acting ([4,1,7], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000ec' -> pg 1.a1fea8b1 (1.31) -> up ([0,5,3], p0) acting ([0,5,3], p0)
    osdmap e547 pool 'volumes' (1) object '000000000000001e' -> pg 1.70c1e7c7 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000c6' -> pg 1.61428c48 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000003a' -> pg 1.608353a0 (1.20) -> up ([1,7,4], p1) acting ([1,7,4], p1)
    osdmap e547 pool 'volumes' (1) object '00000000000000da' -> pg 1.d7ef51f6 (1.36) -> up ([7,0,8], p7) acting ([7,0,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ee' -> pg 1.cf2b6a2a (1.2a) -> up ([5,2,1], p5) acting ([5,2,1], p5)
    osdmap e547 pool 'volumes' (1) object '000000000000006e' -> pg 1.dc761c94 (1.14) -> up ([5,0,3], p5) acting ([5,0,3], p5)
    osdmap e547 pool 'volumes' (1) object '00000000000000ff' -> pg 1.c9b32086 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000072' -> pg 1.dc10085b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000088' -> pg 1.3509ac0b (1.b) -> up ([1,4,2], p1) acting ([1,4,2], p1)
    osdmap e547 pool 'volumes' (1) object '0000000000000007' -> pg 1.26b08d09 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000a4' -> pg 1.30e88454 (1.14) -> up ([5,0,3], p5) acting ([5,0,3], p5)
    osdmap e547 pool 'volumes' (1) object '00000000000000d4' -> pg 1.2cac93f4 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '000000000000001c' -> pg 1.bea74bae (1.2e) -> up ([8,6,2], p8) acting ([8,6,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000046' -> pg 1.aba54884 (1.4) -> up ([1,3,5], p1) acting ([1,3,5], p1)
    osdmap e547 pool 'volumes' (1) object '0000000000000080' -> pg 1.1dacc442 (1.2) -> up ([0,4,3], p0) acting ([0,4,3], p0)
    osdmap e547 pool 'volumes' (1) object '0000000000000038' -> pg 1.672a3e9b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000008a' -> pg 1.f7ca0970 (1.30) -> up ([3,0,5], p3) acting ([3,0,5], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000002c' -> pg 1.a37c1067 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000026' -> pg 1.8bcbf27c (1.3c) -> up ([0,8,2], p0) acting ([0,8,2], p0)
    osdmap e547 pool 'volumes' (1) object '000000000000007e' -> pg 1.88167cfc (1.3c) -> up ([0,8,2], p0) acting ([0,8,2], p0)
    osdmap e547 pool 'volumes' (1) object '00000000000000aa' -> pg 1.db53da95 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000009a' -> pg 1.f395b54d (1.d) -> up ([4,1,7], p4) acting ([4,1,7], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000b2' -> pg 1.ef19a482 (1.2) -> up ([0,4,3], p0) acting ([0,4,3], p0)
    osdmap e547 pool 'volumes' (1) object '00000000000000fe' -> pg 1.b5e990e4 (1.24) -> up ([3,8,6], p3) acting ([3,8,6], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000074' -> pg 1.bb5d9755 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000004' -> pg 1.52df8b5b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000f2' -> pg 1.4bf8d866 (1.26) -> up ([3,4,6], p3) acting ([3,4,6], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000002a' -> pg 1.c36bdd8 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000076' -> pg 1.fcad380f (1.f) -> up ([3,0,8], p3) acting ([3,0,8], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000007c' -> pg 1.1e49ea32 (1.32) -> up ([7,5,6], p7) acting ([7,5,6], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ac' -> pg 1.e5189dd (1.1d) -> up ([1,3,4], p1) acting ([1,3,4], p1)
    osdmap e547 pool 'volumes' (1) object '0000000000000014' -> pg 1.8eab115a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000040' -> pg 1.25a5645f (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ce' -> pg 1.2bad60e0 (1.20) -> up ([1,7,4], p1) acting ([1,7,4], p1)
    osdmap e547 pool 'volumes' (1) object '00000000000000e8' -> pg 1.3f56e8c6 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000ae' -> pg 1.520dd77b (1.3b) -> up ([8,3,1], p8) acting ([8,3,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000028' -> pg 1.6192ebd2 (1.12) -> up ([2,1,5], p2) acting ([2,1,5], p2)
    osdmap e547 pool 'volumes' (1) object '000000000000006c' -> pg 1.6b0c817e (1.3e) -> up ([3,6,8], p3) acting ([3,6,8], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000036' -> pg 1.6ce9b7b0 (1.30) -> up ([3,0,5], p3) acting ([3,0,5], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000002e' -> pg 1.59cec36a (1.2a) -> up ([5,2,1], p5) acting ([5,2,1], p5)
    osdmap e547 pool 'volumes' (1) object '0000000000000016' -> pg 1.f5df1897 (1.17) -> up ([0,2,8], p0) acting ([0,2,8], p0)
    osdmap e547 pool 'volumes' (1) object '0000000000000094' -> pg 1.4009eced (1.2d) -> up ([6,2,5], p6) acting ([6,2,5], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000050' -> pg 1.670516dd (1.1d) -> up ([1,3,4], p1) acting ([1,3,4], p1)
    osdmap e547 pool 'volumes' (1) object '00000000000000d2' -> pg 1.135408d2 (1.12) -> up ([2,1,5], p2) acting ([2,1,5], p2)
    osdmap e547 pool 'volumes' (1) object '0000000000000052' -> pg 1.d6975922 (1.22) -> up ([6,3,5], p6) acting ([6,3,5], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000078' -> pg 1.ca3452be (1.3e) -> up ([3,6,8], p3) acting ([3,6,8], p3)
    osdmap e547 pool 'volumes' (1) object '00000000000000e6' -> pg 1.99ab2ad (1.2d) -> up ([6,2,5], p6) acting ([6,2,5], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000b6' -> pg 1.b172b53f (1.3f) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000003' -> pg 1.e29597e (1.3e) -> up ([3,6,8], p3) acting ([3,6,8], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000008' -> pg 1.aba9d1ff (1.3f) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000004c' -> pg 1.3a8a009 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000005' -> pg 1.cd0045cc (1.c) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000062' -> pg 1.c2166d49 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000068' -> pg 1.7909a394 (1.14) -> up ([5,0,3], p5) acting ([5,0,3], p5)
    osdmap e547 pool 'volumes' (1) object '0000000000000048' -> pg 1.93f531b4 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000054' -> pg 1.2bb8b39 (1.39) -> up ([7,5,0], p7) acting ([7,5,0], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000de' -> pg 1.aa02a720 (1.20) -> up ([1,7,4], p1) acting ([1,7,4], p1)
    osdmap e547 pool 'volumes' (1) object '000000000000005c' -> pg 1.f17bcc99 (1.19) -> up ([3,0,8], p3) acting ([3,0,8], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000042' -> pg 1.8fbd09c1 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000007a' -> pg 1.365a4b4c (1.c) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000f6' -> pg 1.dcb35d41 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000a6' -> pg 1.af2f2ac (1.2c) -> up ([7,8,0], p7) acting ([7,8,0], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000f8' -> pg 1.da038c86 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000ea' -> pg 1.4a713f74 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000fa' -> pg 1.fc92599c (1.1c) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000000' -> pg 1.e4533d09 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000a0' -> pg 1.4ba225e9 (1.29) -> up ([2,0,5], p2) acting ([2,0,5], p2)
    osdmap e547 pool 'volumes' (1) object '00000000000000b0' -> pg 1.f7811e (1.1e) -> up ([3,6,5], p3) acting ([3,6,5], p3)
    osdmap e547 pool 'volumes' (1) object '00000000000000d6' -> pg 1.7bcfd58a (1.a) -> up ([5,2,0], p5) acting ([5,2,0], p5)
    osdmap e547 pool 'volumes' (1) object '0000000000000012' -> pg 1.7a711a55 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000d0' -> pg 1.a4626f8 (1.38) -> up ([3,6,5], p3) acting ([3,6,5], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000022' -> pg 1.7c02b1fa (1.3a) -> up ([4,7,1], p4) acting ([4,7,1], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000018' -> pg 1.5d735853 (1.13) -> up ([1,5,3], p1) acting ([1,5,3], p1)
    osdmap e547 pool 'volumes' (1) object '00000000000000b8' -> pg 1.e75a06c1 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000c4' -> pg 1.d78e6111 (1.11) -> up ([8,3,6], p8) acting ([8,3,6], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000008c' -> pg 1.6c3a4600 (1.0) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000005a' -> pg 1.58c42ad6 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000b4' -> pg 1.c0dccf19 (1.19) -> up ([3,0,8], p3) acting ([3,0,8], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000008e' -> pg 1.aae90cc7 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000009c' -> pg 1.e7208bf1 (1.31) -> up ([0,5,3], p0) acting ([0,5,3], p0)
    osdmap e547 pool 'volumes' (1) object '000000000000001a' -> pg 1.6ae4e20d (1.d) -> up ([4,1,7], p4) acting ([4,1,7], p4)
    osdmap e547 pool 'volumes' (1) object '000000000000003c' -> pg 1.88160c37 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000082' -> pg 1.92774d56 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000be' -> pg 1.5bc9b86 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000e2' -> pg 1.623f5db4 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000bc' -> pg 1.99115a14 (1.14) -> up ([5,0,3], p5) acting ([5,0,3], p5)
    osdmap e547 pool 'volumes' (1) object '0000000000000032' -> pg 1.cb15a9d8 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000a8' -> pg 1.737dba65 (1.25) -> up ([1,8,3], p1) acting ([1,8,3], p1)
    osdmap e547 pool 'volumes' (1) object '00000000000000dc' -> pg 1.7109ecc8 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000f4' -> pg 1.8998de9c (1.1c) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000090' -> pg 1.d1666207 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000058' -> pg 1.387141f4 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000098' -> pg 1.6a376b34 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000034' -> pg 1.6bd91348 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000009' -> pg 1.3d89dfa7 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000064' -> pg 1.ac395aa1 (1.21) -> up ([3,4,0], p3) acting ([3,4,0], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000000a' -> pg 1.e9830e03 (1.3) -> up ([4,7,0], p4) acting ([4,7,0], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000002' -> pg 1.126a3b99 (1.19) -> up ([3,0,8], p3) acting ([3,0,8], p3)
    osdmap e547 pool 'volumes' (1) object '000000000000000e' -> pg 1.40961b4d (1.d) -> up ([4,1,7], p4) acting ([4,1,7], p4)
    osdmap e547 pool 'volumes' (1) object '0000000000000024' -> pg 1.5e818f58 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000ba' -> pg 1.bfc625d6 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000cc' -> pg 1.2e2cf8ce (1.e) -> up ([4,1,2], p4) acting ([4,1,2], p4)
    osdmap e547 pool 'volumes' (1) object '000000000000004e' -> pg 1.c97936ce (1.e) -> up ([4,1,2], p4) acting ([4,1,2], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000a2' -> pg 1.3ac99d96 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000030' -> pg 1.fb410adf (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000005e' -> pg 1.f85ab451 (1.11) -> up ([8,3,6], p8) acting ([8,3,6], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000044' -> pg 1.b094b888 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000e4' -> pg 1.f22d7a9 (1.29) -> up ([2,0,5], p2) acting ([2,0,5], p2)
    osdmap e547 pool 'volumes' (1) object '0000000000000084' -> pg 1.78c9cb61 (1.21) -> up ([3,4,0], p3) acting ([3,4,0], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000020' -> pg 1.27635db7 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000c0' -> pg 1.8f2db7a8 (1.28) -> up ([5,2,0], p5) acting ([5,2,0], p5)
    osdmap e547 pool 'volumes' (1) object '00000000000000f0' -> pg 1.d53f0ff8 (1.38) -> up ([3,6,5], p3) acting ([3,6,5], p3)
    osdmap e547 pool 'volumes' (1) object '00000000000000d8' -> pg 1.1468d175 (1.35) -> up ([3,8,6], p3) acting ([3,8,6], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000066' -> pg 1.22b4f71a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000000c' -> pg 1.79075b2a (1.2a) -> up ([5,2,1], p5) acting ([5,2,1], p5)
    osdmap e547 pool 'volumes' (1) object '0000000000000006' -> pg 1.afdc4b85 (1.5) -> up ([2,6,8], p2) acting ([2,6,8], p2)
    osdmap e547 pool 'volumes' (1) object '0000000000000070' -> pg 1.c5ff8465 (1.25) -> up ([1,8,3], p1) acting ([1,8,3], p1)
    osdmap e547 pool 'volumes' (1) object '000000000000006a' -> pg 1.4cdb76d5 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000056' -> pg 1.6b2dea67 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000004a' -> pg 1.edc2a79f (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000092' -> pg 1.41fa1e54 (1.14) -> up ([5,0,3], p5) acting ([5,0,3], p5)
    osdmap e547 pool 'volumes' (1) object '00000000000000ca' -> pg 1.13e7cff7 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000c2' -> pg 1.90e05338 (1.38) -> up ([3,6,5], p3) acting ([3,6,5], p3)
    osdmap e547 pool 'volumes' (1) object '0000000000000096' -> pg 1.71c392f4 (1.34) -> up ([4,6,7], p4) acting ([4,6,7], p4)
    osdmap e547 pool 'volumes' (1) object '00000000000000e0' -> pg 1.1cd52c05 (1.5) -> up ([2,6,8], p2) acting ([2,6,8], p2)
     
    [root@ceph1 ~]# cat 9709dd70.txt | egrep "p6|p7|p8"
    osdmap e547 pool 'volumes' (1) object '0000000000000086' -> pg 1.4f695e1a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000003e' -> pg 1.4430cc36 (1.36) -> up ([7,0,8], p7) acting ([7,0,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000c8' -> pg 1.9eeaa646 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000010' -> pg 1.b25a3a00 (1.0) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000001e' -> pg 1.70c1e7c7 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000c6' -> pg 1.61428c48 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000da' -> pg 1.d7ef51f6 (1.36) -> up ([7,0,8], p7) acting ([7,0,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ff' -> pg 1.c9b32086 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000072' -> pg 1.dc10085b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000007' -> pg 1.26b08d09 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000001c' -> pg 1.bea74bae (1.2e) -> up ([8,6,2], p8) acting ([8,6,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000038' -> pg 1.672a3e9b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000002c' -> pg 1.a37c1067 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000aa' -> pg 1.db53da95 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000074' -> pg 1.bb5d9755 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000004' -> pg 1.52df8b5b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000002a' -> pg 1.c36bdd8 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000007c' -> pg 1.1e49ea32 (1.32) -> up ([7,5,6], p7) acting ([7,5,6], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000014' -> pg 1.8eab115a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000040' -> pg 1.25a5645f (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000e8' -> pg 1.3f56e8c6 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000ae' -> pg 1.520dd77b (1.3b) -> up ([8,3,1], p8) acting ([8,3,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000094' -> pg 1.4009eced (1.2d) -> up ([6,2,5], p6) acting ([6,2,5], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000052' -> pg 1.d6975922 (1.22) -> up ([6,3,5], p6) acting ([6,3,5], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000e6' -> pg 1.99ab2ad (1.2d) -> up ([6,2,5], p6) acting ([6,2,5], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000b6' -> pg 1.b172b53f (1.3f) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000008' -> pg 1.aba9d1ff (1.3f) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000004c' -> pg 1.3a8a009 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000005' -> pg 1.cd0045cc (1.c) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000062' -> pg 1.c2166d49 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000054' -> pg 1.2bb8b39 (1.39) -> up ([7,5,0], p7) acting ([7,5,0], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000042' -> pg 1.8fbd09c1 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000007a' -> pg 1.365a4b4c (1.c) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000f6' -> pg 1.dcb35d41 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000a6' -> pg 1.af2f2ac (1.2c) -> up ([7,8,0], p7) acting ([7,8,0], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000f8' -> pg 1.da038c86 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000fa' -> pg 1.fc92599c (1.1c) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000000' -> pg 1.e4533d09 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000012' -> pg 1.7a711a55 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000b8' -> pg 1.e75a06c1 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000c4' -> pg 1.d78e6111 (1.11) -> up ([8,3,6], p8) acting ([8,3,6], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000008c' -> pg 1.6c3a4600 (1.0) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000005a' -> pg 1.58c42ad6 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000008e' -> pg 1.aae90cc7 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000003c' -> pg 1.88160c37 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000082' -> pg 1.92774d56 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000be' -> pg 1.5bc9b86 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000032' -> pg 1.cb15a9d8 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000dc' -> pg 1.7109ecc8 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000f4' -> pg 1.8998de9c (1.1c) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000090' -> pg 1.d1666207 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000034' -> pg 1.6bd91348 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000009' -> pg 1.3d89dfa7 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000024' -> pg 1.5e818f58 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000ba' -> pg 1.bfc625d6 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000a2' -> pg 1.3ac99d96 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000030' -> pg 1.fb410adf (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000005e' -> pg 1.f85ab451 (1.11) -> up ([8,3,6], p8) acting ([8,3,6], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000044' -> pg 1.b094b888 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000020' -> pg 1.27635db7 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000066' -> pg 1.22b4f71a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000006a' -> pg 1.4cdb76d5 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000056' -> pg 1.6b2dea67 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000004a' -> pg 1.edc2a79f (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ca' -> pg 1.13e7cff7 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    使用正则表达式晒选是否包含在osd
    [root@ceph1 ~]# ceph osd tree | grep ssd
    6 ssd 0.09769 osd.6 up 1.00000 1.00000
    7 ssd 0.09769 osd.7 up 1.00000 1.00000
    8 ssd 0.09769 osd.8 up 1.00000 1.00000
     
    [root@ceph1 ~]# cat 9709dd70.txt | egrep "p6|p7|p8"
    osdmap e547 pool 'volumes' (1) object '0000000000000086' -> pg 1.4f695e1a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000003e' -> pg 1.4430cc36 (1.36) -> up ([7,0,8], p7) acting ([7,0,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000c8' -> pg 1.9eeaa646 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000010' -> pg 1.b25a3a00 (1.0) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000001e' -> pg 1.70c1e7c7 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000c6' -> pg 1.61428c48 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000da' -> pg 1.d7ef51f6 (1.36) -> up ([7,0,8], p7) acting ([7,0,8], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ff' -> pg 1.c9b32086 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000072' -> pg 1.dc10085b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000007' -> pg 1.26b08d09 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000001c' -> pg 1.bea74bae (1.2e) -> up ([8,6,2], p8) acting ([8,6,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000038' -> pg 1.672a3e9b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000002c' -> pg 1.a37c1067 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000aa' -> pg 1.db53da95 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000074' -> pg 1.bb5d9755 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000004' -> pg 1.52df8b5b (1.1b) -> up ([8,0,3], p8) acting ([8,0,3], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000002a' -> pg 1.c36bdd8 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000007c' -> pg 1.1e49ea32 (1.32) -> up ([7,5,6], p7) acting ([7,5,6], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000014' -> pg 1.8eab115a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000040' -> pg 1.25a5645f (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000e8' -> pg 1.3f56e8c6 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000ae' -> pg 1.520dd77b (1.3b) -> up ([8,3,1], p8) acting ([8,3,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000094' -> pg 1.4009eced (1.2d) -> up ([6,2,5], p6) acting ([6,2,5], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000052' -> pg 1.d6975922 (1.22) -> up ([6,3,5], p6) acting ([6,3,5], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000e6' -> pg 1.99ab2ad (1.2d) -> up ([6,2,5], p6) acting ([6,2,5], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000b6' -> pg 1.b172b53f (1.3f) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000008' -> pg 1.aba9d1ff (1.3f) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000004c' -> pg 1.3a8a009 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000005' -> pg 1.cd0045cc (1.c) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000062' -> pg 1.c2166d49 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000054' -> pg 1.2bb8b39 (1.39) -> up ([7,5,0], p7) acting ([7,5,0], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000042' -> pg 1.8fbd09c1 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000007a' -> pg 1.365a4b4c (1.c) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000f6' -> pg 1.dcb35d41 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000a6' -> pg 1.af2f2ac (1.2c) -> up ([7,8,0], p7) acting ([7,8,0], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000f8' -> pg 1.da038c86 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000fa' -> pg 1.fc92599c (1.1c) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000000' -> pg 1.e4533d09 (1.9) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000012' -> pg 1.7a711a55 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '00000000000000b8' -> pg 1.e75a06c1 (1.1) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000c4' -> pg 1.d78e6111 (1.11) -> up ([8,3,6], p8) acting ([8,3,6], p8)
    osdmap e547 pool 'volumes' (1) object '000000000000008c' -> pg 1.6c3a4600 (1.0) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000005a' -> pg 1.58c42ad6 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000008e' -> pg 1.aae90cc7 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '000000000000003c' -> pg 1.88160c37 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000082' -> pg 1.92774d56 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000be' -> pg 1.5bc9b86 (1.6) -> up ([8,6,7], p8) acting ([8,6,7], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000032' -> pg 1.cb15a9d8 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000dc' -> pg 1.7109ecc8 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000f4' -> pg 1.8998de9c (1.1c) -> up ([8,1,2], p8) acting ([8,1,2], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000090' -> pg 1.d1666207 (1.7) -> up ([6,3,8], p6) acting ([6,3,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000034' -> pg 1.6bd91348 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000009' -> pg 1.3d89dfa7 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000024' -> pg 1.5e818f58 (1.18) -> up ([6,4,3], p6) acting ([6,4,3], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000ba' -> pg 1.bfc625d6 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '00000000000000a2' -> pg 1.3ac99d96 (1.16) -> up ([6,2,8], p6) acting ([6,2,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000030' -> pg 1.fb410adf (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000005e' -> pg 1.f85ab451 (1.11) -> up ([8,3,6], p8) acting ([8,3,6], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000044' -> pg 1.b094b888 (1.8) -> up ([6,7,8], p6) acting ([6,7,8], p6)
    osdmap e547 pool 'volumes' (1) object '0000000000000020' -> pg 1.27635db7 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    osdmap e547 pool 'volumes' (1) object '0000000000000066' -> pg 1.22b4f71a (1.1a) -> up ([7,6,8], p7) acting ([7,6,8], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000006a' -> pg 1.4cdb76d5 (1.15) -> up ([8,7,1], p8) acting ([8,7,1], p8)
    osdmap e547 pool 'volumes' (1) object '0000000000000056' -> pg 1.6b2dea67 (1.27) -> up ([7,1,5], p7) acting ([7,1,5], p7)
    osdmap e547 pool 'volumes' (1) object '000000000000004a' -> pg 1.edc2a79f (1.1f) -> up ([7,4,1], p7) acting ([7,4,1], p7)
    osdmap e547 pool 'volumes' (1) object '00000000000000ca' -> pg 1.13e7cff7 (1.37) -> up ([7,1,8], p7) acting ([7,1,8], p7)
    很明显,此盘数据有写到ssd盘上,看看容量分配情况
    [root@ceph1 ~]# cat 9709dd70.txt | egrep "p6|p7|p8" | wc -l
    65
    [root@ceph1 ~]# cat 9709dd70.txt | wc -l
    133
    三 其实第二步证明可以通过crushtool测试
    [root@ceph1 ~]# crushtool -i a.map --test --min-x 0 --max-x 20 --num-rep 3 --ruleset 0 --show_mappings
    CRUSH rule 0 x 0 [0,5,3]
    CRUSH rule 0 x 1 [5,1,3]
    CRUSH rule 0 x 2 [7,6,8]
    CRUSH rule 0 x 3 [3,0,8]
    CRUSH rule 0 x 4 [1,8,3]
    CRUSH rule 0 x 5 [3,4,6]
    CRUSH rule 0 x 6 [6,7,4]
    CRUSH rule 0 x 7 [2,6,8]
    CRUSH rule 0 x 8 [2,5,0]
    CRUSH rule 0 x 9 [6,3,5]
    CRUSH rule 0 x 10 [4,7,6]
    CRUSH rule 0 x 11 [5,3,0]
    CRUSH rule 0 x 12 [6,7,8]
    CRUSH rule 0 x 13 [8,3,1]
    CRUSH rule 0 x 14 [5,2,1]
    CRUSH rule 0 x 15 [8,7,6]
    CRUSH rule 0 x 16 [8,3,0]
    CRUSH rule 0 x 17 [2,1,5]
    CRUSH rule 0 x 18 [1,4,7]
    CRUSH rule 0 x 19 [0,5,7]
    CRUSH rule 0 x 20 [6,4,3]
    筛选后:
    [root@ceph1 ~]# crushtool -i a.map --test --min-x 0 --max-x 20 --num-rep 3 --ruleset 0 --show_mappings | awk '{print $6}' | egrep "6|7|8" | wc -l
    15
    很明显,有写数据到ssd硬盘里面。
    三 修改crush rules策略
    修改b文件
    # rules
    rule replicated_rule {
    id 0
    type replicated
    min_size 1
    max_size 10
    step take default class hdd
    step chooseleaf firstn 0 type host
    step emit
    }
    rule rule-ssd {
    id 1
    type replicated
    min_size 1
    max_size 10
    step take default class ssd
    step chooseleaf firstn 0 type host
    step emit
    }
    2 编译成二进制文件
    [root@ceph1 ~]# crushtool -c b -o crushmap.new
    导入ceph集群
    [root@ceph1 ~]# ceph osd setcrushmap -i crushmap.new
    36
    观察集群情况,等待收敛正常后
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    6/2148 objects misplaced (0.279%)
    Reduced data availability: 115 pgs inactive, 325 pgs peering
    Degraded data redundancy: 697/2148 objects degraded (32.449%), 30 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 33.504% pgs not active
    697/2148 objects degraded (32.449%)
    6/2148 objects misplaced (0.279%)
    617 active+clean
    327 peering
    30 active+recovery_wait+degraded
    2 active+recovering
     
    io:
    recovery: 32.2KiB/s, 0objects/s
     
    [root@ceph1 ~]# ceph osd tree
    ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
    -1 0.76199 root default
    -9 0.25400 rack rack01
    -3 0.25400 host ceph1
    0 hdd 0.07799 osd.0 up 1.00000 1.00000
    1 hdd 0.07799 osd.1 up 1.00000 1.00000
    6 ssd 0.09799 osd.6 up 1.00000 1.00000
    -10 0.25400 rack rack02
    -5 0.25400 host ceph2
    2 hdd 0.07799 osd.2 up 1.00000 1.00000
    3 hdd 0.07799 osd.3 up 1.00000 1.00000
    7 ssd 0.09799 osd.7 up 1.00000 1.00000
    -11 0.25400 rack rack03
    -7 0.25400 host ceph3
    4 hdd 0.07799 osd.4 up 1.00000 1.00000
    5 hdd 0.07799 osd.5 up 1.00000 1.00000
    8 ssd 0.09799 osd.8 up 1.00000 1.00000
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    11/2148 objects misplaced (0.512%)
    Degraded data redundancy: 1584/2148 objects degraded (73.743%), 64 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 1584/2148 objects degraded (73.743%)
    11/2148 objects misplaced (0.512%)
    910 active+clean
    64 active+recovery_wait+degraded
    2 active+recovering
     
    io:
    client: 9.07KiB/s rd, 11op/s rd, 0op/s wr
    recovery: 14.0MiB/s, 3keys/s, 7objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    18/2148 objects misplaced (0.838%)
    Degraded data redundancy: 1328/2148 objects degraded (61.825%), 52 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 1328/2148 objects degraded (61.825%)
    18/2148 objects misplaced (0.838%)
    923 active+clean
    52 active+recovery_wait+degraded
    1 active+recovering
     
    io:
    recovery: 18.9MiB/s, 11objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    5/2148 objects misplaced (0.233%)
    Degraded data redundancy: 1265/2148 objects degraded (58.892%), 49 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 1265/2148 objects degraded (58.892%)
    5/2148 objects misplaced (0.233%)
    926 active+clean
    49 active+recovery_wait+degraded
    1 active+recovering
     
    io:
    recovery: 16.6MiB/s, 0keys/s, 9objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    5/2148 objects misplaced (0.233%)
    Degraded data redundancy: 1265/2148 objects degraded (58.892%), 49 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 1265/2148 objects degraded (58.892%)
    5/2148 objects misplaced (0.233%)
    926 active+clean
    49 active+recovery_wait+degraded
    1 active+recovering
     
    io:
    recovery: 16.6MiB/s, 0keys/s, 9objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    16/2148 objects misplaced (0.745%)
    Degraded data redundancy: 1134/2148 objects degraded (52.793%), 39 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 1134/2148 objects degraded (52.793%)
    16/2148 objects misplaced (0.745%)
    936 active+clean
    38 active+recovery_wait+degraded
    1 active+recovering
    1 active+recovering+degraded
     
    io:
    recovery: 25.8MiB/s, 1keys/s, 14objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    16/2148 objects misplaced (0.745%)
    Degraded data redundancy: 1134/2148 objects degraded (52.793%), 39 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 1134/2148 objects degraded (52.793%)
    16/2148 objects misplaced (0.745%)
    936 active+clean
    38 active+recovery_wait+degraded
    1 active+recovering
    1 active+recovering+degraded
     
    io:
    recovery: 19.3MiB/s, 1keys/s, 11objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    4/2148 objects misplaced (0.186%)
    Degraded data redundancy: 993/2148 objects degraded (46.229%), 34 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 993/2148 objects degraded (46.229%)
    4/2148 objects misplaced (0.186%)
    940 active+clean
    34 active+recovery_wait+degraded
    2 active+recovering
     
    io:
    recovery: 26.5MiB/s, 1keys/s, 16objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    4/2148 objects misplaced (0.186%)
    Degraded data redundancy: 993/2148 objects degraded (46.229%), 34 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 993/2148 objects degraded (46.229%)
    4/2148 objects misplaced (0.186%)
    940 active+clean
    34 active+recovery_wait+degraded
    2 active+recovering
     
    io:
    recovery: 26.5MiB/s, 1keys/s, 16objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    4/2148 objects misplaced (0.186%)
    Degraded data redundancy: 959/2148 objects degraded (44.646%), 33 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.5GiB used, 765GiB / 780GiB avail
    pgs: 959/2148 objects degraded (44.646%)
    4/2148 objects misplaced (0.186%)
    942 active+clean
    33 active+recovery_wait+degraded
    1 active+recovering
     
    io:
    recovery: 25.5MiB/s, 1keys/s, 16objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_WARN
    20/2148 objects misplaced (0.931%)
    Degraded data redundancy: 490/2148 objects degraded (22.812%), 17 pgs degraded
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.5GiB used, 766GiB / 780GiB avail
    pgs: 490/2148 objects degraded (22.812%)
    20/2148 objects misplaced (0.931%)
    958 active+clean
    17 active+recovery_wait+degraded
    1 active+recovering
     
    io:
    recovery: 12.2MiB/s, 0keys/s, 8objects/s
     
    [root@ceph1 ~]# ceph -s
    cluster:
    id: 6bbab2f3-f90c-439d-86d7-9c0f3603303c
    health: HEALTH_OK
     
    services:
    mon: 3 daemons, quorum ceph1,ceph2,ceph3
    mgr: ceph1(active), standbys: ceph2, ceph3
    mds: leadorfs-1/1/1 up {0=ceph1=up:active}
    osd: 9 osds: 9 up, 9 in
     
    data:
    pools: 14 pools, 976 pgs
    objects: 716 objects, 1.85GiB
    usage: 14.4GiB used, 766GiB / 780GiB avail
    pgs: 976 active+clean
     
    io:
    client: 9.07KiB/s rd, 11op/s rd, 0op/s wr
    重新进行测试,不再将数据写到ssd盘了
    [root@ceph1 ~]# crushtool -i crushmap.new --test --min-x 0 --max-x 30 --num-rep 3 --ruleset 0 --show_mappings
    CRUSH rule 0 x 0 [3,0,4]
    CRUSH rule 0 x 1 [0,2,4]
    CRUSH rule 0 x 2 [4,2,0]
    CRUSH rule 0 x 3 [4,0,3]
    CRUSH rule 0 x 4 [5,0,2]
    CRUSH rule 0 x 5 [3,4,0]
    CRUSH rule 0 x 6 [1,2,5]
    CRUSH rule 0 x 7 [2,4,1]
    CRUSH rule 0 x 8 [5,1,3]
    CRUSH rule 0 x 9 [4,3,1]
    CRUSH rule 0 x 10 [2,0,5]
    CRUSH rule 0 x 11 [0,2,5]
    CRUSH rule 0 x 12 [3,4,0]
    CRUSH rule 0 x 13 [0,2,5]
    CRUSH rule 0 x 14 [1,5,2]
    CRUSH rule 0 x 15 [1,2,5]
    CRUSH rule 0 x 16 [4,1,2]
    CRUSH rule 0 x 17 [2,5,0]
    CRUSH rule 0 x 18 [4,3,0]
    CRUSH rule 0 x 19 [0,4,2]
    CRUSH rule 0 x 20 [4,1,2]
    CRUSH rule 0 x 21 [0,4,3]
    CRUSH rule 0 x 22 [1,3,5]
    CRUSH rule 0 x 23 [0,2,5]
    CRUSH rule 0 x 24 [3,1,4]
    CRUSH rule 0 x 25 [3,1,5]
    CRUSH rule 0 x 26 [5,1,3]
    CRUSH rule 0 x 27 [4,3,0]
    CRUSH rule 0 x 28 [3,4,0]
    CRUSH rule 0 x 29 [2,1,5]
    CRUSH rule 0 x 30 [0,3,5]
    100条测试如下:
    [root@ceph1 ~]# crushtool -i crushmap.new --test --min-x 0 --max-x 100 --num-rep 3 --ruleset 0 --show_mappings | awk '{print $6}' | egrep "6|7|8" | wc -l
    0


  • 相关阅读:
    如何在Ubuntu下安装”.deb“、”.bin“、”.tar.gz“、”.tar.bz2“格式的软件包!
    安装tar.bz2文件
    tiny6410nfs挂载问题
    tiny6410SDK制作NFS文件系统
    linux压缩解压
    tiny6410的linux操作系统实验开发
    ubis文件系统的制作
    motion移植
    linux系统调用函数---12
    LED驱动程序分析
  • 原文地址:https://www.cnblogs.com/cloud-datacenter/p/13200263.html
Copyright © 2020-2023  润新知