ceph:modifying_crush_map
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ceph:modifying_crush_map [2019/07/18 07:17] – external edit 127.0.0.1 | ceph:modifying_crush_map [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Modifying CRUSH map ====== | ||
- | |||
- | ^ Documentation | ||
- | ^Name:| Modifying CRUSH map | | ||
- | ^Description: | ||
- | ^Modification date : | ||
- | ^Owner: | ||
- | ^Notify changes to:|Owner| | ||
- | ^Tags:| ceph, object storage| | ||
- | |||
- | |||
- | ====== Information ====== | ||
- | <WRAP center round alert 60%> | ||
- | The described process is a advanced process, take care. | ||
- | </ | ||
- | |||
- | ====== Pre-Requirements ====== | ||
- | * Knowledge of ceph management | ||
- | * Understand of CRUSH | ||
- | * Understand of CRUSH mapping options | ||
- | |||
- | |||
- | |||
- | ====== Instructions ====== | ||
- | |||
- | ===== Review actual CRUSH tree ===== | ||
- | <code bash> | ||
- | ceph osd crush tree | ||
- | </ | ||
- | |||
- | Example: | ||
- | < | ||
- | avmlp-osm-001 ~ # ceph osd crush tree | ||
- | ID CLASS WEIGHT | ||
- | | ||
- | | ||
- | 0 | ||
- | | ||
- | 1 | ||
- | | ||
- | 2 | ||
- | | ||
- | 3 | ||
- | -11 1.99899 | ||
- | 4 | ||
- | -13 1.99899 | ||
- | 5 | ||
- | -15 1.99899 | ||
- | 6 | ||
- | -17 1.99899 | ||
- | 7 | ||
- | -19 1.99899 | ||
- | 8 | ||
- | -21 1.99899 | ||
- | 9 | ||
- | -23 1.99899 | ||
- | | ||
- | -25 1.99899 | ||
- | | ||
- | -27 1.99899 | ||
- | | ||
- | -29 1.99899 | ||
- | | ||
- | -31 1.99899 | ||
- | | ||
- | -33 1.99899 | ||
- | | ||
- | -35 1.99899 | ||
- | | ||
- | -37 1.99899 | ||
- | | ||
- | -39 1.99899 | ||
- | | ||
- | -41 1.99899 | ||
- | | ||
- | </ | ||
- | |||
- | |||
- | ===== Get actual map ===== | ||
- | This command export the map from the running cluster, the file is **binary**: | ||
- | <code bash> | ||
- | ceph osd getcrushmap | ||
- | </ | ||
- | |||
- | ===== Convert the map to text ===== | ||
- | <code bash> | ||
- | crushtool | ||
- | </ | ||
- | |||
- | ===== the map file ===== | ||
- | The file has the hierarchy of the tree as follows: | ||
- | * root | ||
- | * datacenter (if defined) | ||
- | * rack (if defined) | ||
- | * host | ||
- | \\ | ||
- | Each item is defined as this example: | ||
- | ^ rack | < | ||
- | root default { | ||
- | id -1 # do not change unnecessarily | ||
- | id -2 class hdd # do not change unnecessarily | ||
- | # weight 39.980 | ||
- | alg straw2 | ||
- | hash 0 # rjenkins1 | ||
- | item itconic weight 0.000 | ||
- | item mediacloud weight 0.000 | ||
- | } | ||
- | </ | ||
- | ^ datacenter | < | ||
- | datacenter itconic { | ||
- | id -44 # do not change unnecessarily | ||
- | id -46 class hdd # do not change unnecessarily | ||
- | # weight 0.000 | ||
- | alg straw2 | ||
- | hash 0 # rjenkins1 | ||
- | item datacenter01 weight 0.000 | ||
- | } | ||
- | </ | ||
- | |||
- | So each " | ||
- | |||
- | |||
- | |||
- | ===== Compile the new map ===== | ||
- | |||
- | <code bash> | ||
- | crushtool -c crushmap.txt -o crushmap.new | ||
- | </ | ||
- | |||
- | |||
- | ===== Apply the new map ===== | ||
- | |||
- | <code bash> | ||
- | ceph osd setcrushmap -i crushmap.new | ||
- | </ | ||
- | |||
- | ===== Review the Map ===== | ||
- | <code bash> | ||
- | ceph osd crush tree | ||
- | </ | ||
- | |||
- | Sample: | ||
- | < | ||
- | avmlp-osm-001 ~ :( # ceph osd crush tree | ||
- | ID CLASS WEIGHT | ||
- | | ||
- | -44 | ||
- | -43 | ||
- | | ||
- | 0 hdd 1.99899 | ||
- | | ||
- | 2 hdd 1.99899 | ||
- | -11 | ||
- | 4 hdd 1.99899 | ||
- | -15 | ||
- | 6 hdd 1.99899 | ||
- | -19 | ||
- | 8 hdd 1.99899 | ||
- | -23 | ||
- | | ||
- | -27 | ||
- | | ||
- | -31 | ||
- | | ||
- | -35 | ||
- | | ||
- | -39 | ||
- | | ||
- | -48 | ||
- | -47 | ||
- | | ||
- | 1 hdd 1.99899 | ||
- | | ||
- | 3 hdd 1.99899 | ||
- | -13 | ||
- | 5 hdd 1.99899 | ||
- | -17 | ||
- | 7 hdd 1.99899 | ||
- | -21 | ||
- | 9 hdd 1.99899 | ||
- | -25 | ||
- | | ||
- | -29 | ||
- | | ||
- | -33 | ||
- | | ||
- | -37 | ||
- | | ||
- | -41 | ||
- | | ||
- | </ | ||
- | |||
- | ====== External documentation ====== | ||
- | |||
- | * [[http:// | ||
- | * [[https:// | ||