Bucket命令

创建Bucket

  1. root@dev:/# ceph osd tree
  2. ID WEIGHT TYPE NAME UP/DOWN REWEIGHT PRIMARY-AFFINITY
  3. -1 1.00000 root default
  4. -2 1.00000 host dev
  5. 0 1.00000 osd.0 up 1.00000 1.00000
  6. root@dev:/# ceph osd crush add-bucket rack01 rack
  7. added bucket rack01 type rack to crush map
  8. root@dev:/# ceph osd crush add-bucket rack02 rack
  9. added bucket rack02 type rack to crush map
  10. root@dev:/# ceph osd crush add-bucket rack03 rack
  11. added bucket rack03 type rack to crush map
  12. root@dev:/# ceph osd tree
  13. ID WEIGHT TYPE NAME UP/DOWN REWEIGHT PRIMARY-AFFINITY
  14. -5 0 rack rack03
  15. -4 0 rack rack02
  16. -3 0 rack rack01
  17. -1 1.00000 root default
  18. -2 1.00000 host dev
  19. 0 1.00000 osd.0 up 1.00000 1.00000

移动Rack

  1. root@dev:/# ceph osd crush move rack01 root=default
  2. moved item id -3 name 'rack01' to location {root=default} in crush map
  3. root@dev:/# ceph osd crush move rack02 root=default
  4. moved item id -4 name 'rack02' to location {root=default} in crush map
  5. root@dev:/# ceph osd crush move rack03 root=default
  6. moved item id -5 name 'rack03' to location {root=default} in crush map
  7. root@dev:/# ceph osd tree
  8. ID WEIGHT TYPE NAME UP/DOWN REWEIGHT PRIMARY-AFFINITY
  9. -1 1.00000 root default
  10. -2 1.00000 host dev
  11. 0 1.00000 osd.0 up 1.00000 1.00000
  12. -3 0 rack rack01
  13. -4 0 rack rack02
  14. -5 0 rack rack03