创建ssd root
ceph osd crush add-bucket ssd root
创建hostgroup
ceph osd crush add-bucket ssd-hosts hostgroup ceph osd crush move ssd-hosts root=ssd
创建host
ceph osd crush add-bucket ssd-m1 host ceph osd crush add-bucket ssd-compute host ceph osd crush add-bucket ssd-network host
ceph osd crush move ssd-m1 hostgroup=ssd-hosts ceph osd crush move ssd-compute hostgroup=ssd-hosts ceph osd crush move ssd-network hostgroup=ssd-hosts
移动osd
ceph osd crush set osd.0 1.0 host=ssd-m1 ceph osd crush set osd.1 1.0 host=ssd-compute ceph osd crush set osd.2 1.0 host=ssd-network
创建crush rule
ceph osd crush rule create-simple ssd ssd host firstn
查看crush rule
ceph osd crush rule dump [ { "rule_id": 0, "rule_name": "replicated_ruleset", "ruleset": 0, "type": 1, "min_size": 1, "max_size": 10, "steps": [ { "op": "take", "item": -1, "item_name": "default" }, { "op": "chooseleaf_firstn", "num": 0, "type": "host" }, { "op": "emit" } ] }, { "rule_id": 1, "rule_name": "ssd", "ruleset": 1, "type": 1, "min_size": 1, "max_size": 10, "steps": [ { "op": "take", "item": -9, "item_name": "ssd" }, { "op": "chooseleaf_firstn", "num": 0, "type": "host" }, { "op": "emit" } ] } ]
转载于:https://blog.51cto.com/penguintux/1686479