ceph自定义types

获取当前的crush map

ceph osd getcrushmap -o crushmap
crushtool -d crushmap -o crushmap.txt

编辑crushmap.txt,添加type hostgroup

...
# types
type 0 osd
type 1 host
type 2 chassis
type 3 rack
type 4 row
type 5 pdu
type 6 pod
type 7 room
type 8 datacenter
type 9 region
type 10 root
type 11 hostgroup
...

设置crush map

crushtool -c crushmap.txt -o crushmap.new

ceph osd setcrushmap -i crushmap.new
查看crush

ceph osd crush dump
...
    "types": [
        {
            "type_id": 0,
            "name": "osd"
        },
        {
            "type_id": 1,
            "name": "host"
        },
        {
            "type_id": 2,
            "name": "chassis"
        },
        {
            "type_id": 3,
            "name": "rack"
        },
        {
            "type_id": 4,
            "name": "row"
        },
        {
            "type_id": 5,
            "name": "pdu"
        },
        {
            "type_id": 6,
            "name": "pod"
        },
        {
            "type_id": 7,
            "name": "room"
        },
        {
            "type_id": 8,
            "name": "datacenter"
        },
        {
            "type_id": 9,
            "name": "region"
        },
        {
            "type_id": 10,
            "name": "root"
        },
        {
            "type_id": 11,
            "name": "hostgroup"
        }
    ],
 ...


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