CEPH easy way to edit CRUSH map

Ceph_Logo_Standard_RGB_Black_120411_fa

The CEPH crush map determine how to store nad retrieve data by computing data storage locations. To do this CEPH requies a map of your cluster to tell CRUSH how to distribute data between OSD. Of course you can manually edit crush map whne you need it, but there is an easy way to edit crush map with „ceph osd crush“ command.

Actual crush map you can se by this command:

ceph osd tree

 

Device classes
In default there are tho main device classes, hdd and ssd. You can easy set this by:

ceph osd crush set-device-class class osd-name

 

Modify crush map
Bucket type – You need to know that there are some default types of crush hiearchy – datacenter, room, row, rack host.

Easy way to add new devices – datacenter, rack, chassis and host – to hiearchy root (every new added device is in root, then you can easy move it to another place). Default weight is 1.0 you can edit it later. Name of devices must be unique. OSD is automatically added to CRUSH when you add it to CEPH via ceph-deploy. :

ceph osd crush add-bucket {bucket name} {bucket-type}
ceph osd crush add-bucket Prague datacenter
ceph osd crush add-bucket D52 c
ceph osd crush add-bucket dellPowerEdge-1 chassis
ceph osd crush add-bucket dell-VPS-1 host

 

Now we want to create some hiearchy between these devices. We want to have Datacenter in root hiearchy, rack will be in datacenter and chassis will be in rack, host will be in chassis.

ceph osd crush move D52 datacenter=datacenterPrague
ceph osd crush move dellPowerEdge-1 rack=D52
ceph osd crush move dell-VPS-1 chassis=dellPowerEdge-1

 

And finally we will move osd.1 into host dellPowerEdge1 this way:

ceph osd crush move osd.1 host=dell-VPS-1

 

Our new map now look like this:

ceph osd tree
ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF
-1 1.80499 root default
-19 1.80499 datacenter datacenterPrague
-26 1.80499 rack D52
-27 1.80499 chassis dellPowerEdge-1
-30 1.80499 host dell-VPS-1
12 hdd 1.80499 osd.1 up 1.00000 1.00000

Napsat komentář

Vaše emailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *

Můžete používat následující HTML značky a atributy: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>