User Tools

Site Tools


ceph:modifying_crush_map

This is an old revision of the document!


Modifying CRUSH map

Documentation
Name: Modifying CRUSH map
Description: How to modify CRUSH map
Modification date :11/06/2019
Owner:dodger@ciberterminal.net
Notify changes to:Owner
Tags: ceph, object storage

Information

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

ceph osd crush tree

Example:

avmlp-osm-001 ~ # ceph osd crush tree
ID  CLASS WEIGHT   TYPE NAME              
 -1       39.97986 root default           
 -3        1.99899     host avmlp-osd-001 
  0   hdd  1.99899         osd.0          
 -5        1.99899     host avmlp-osd-002 
  1   hdd  1.99899         osd.1          
 -7        1.99899     host avmlp-osd-003 
  2   hdd  1.99899         osd.2          
 -9        1.99899     host avmlp-osd-004 
  3   hdd  1.99899         osd.3          
-11        1.99899     host avmlp-osd-005 
  4   hdd  1.99899         osd.4          
-13        1.99899     host avmlp-osd-006 
  5   hdd  1.99899         osd.5          
-15        1.99899     host avmlp-osd-007 
  6   hdd  1.99899         osd.6          
-17        1.99899     host avmlp-osd-008 
  7   hdd  1.99899         osd.7          
-19        1.99899     host avmlp-osd-009 
  8   hdd  1.99899         osd.8          
-21        1.99899     host avmlp-osd-010 
  9   hdd  1.99899         osd.9          
-23        1.99899     host avmlp-osd-011 
 10   hdd  1.99899         osd.10         
-25        1.99899     host avmlp-osd-012 
 11   hdd  1.99899         osd.11         
-27        1.99899     host avmlp-osd-013 
 12   hdd  1.99899         osd.12         
-29        1.99899     host avmlp-osd-014 
 13   hdd  1.99899         osd.13         
-31        1.99899     host avmlp-osd-015 
 14   hdd  1.99899         osd.14         
-33        1.99899     host avmlp-osd-016 
 15   hdd  1.99899         osd.15         
-35        1.99899     host avmlp-osd-017 
 16   hdd  1.99899         osd.16         
-37        1.99899     host avmlp-osd-018 
 17   hdd  1.99899         osd.17         
-39        1.99899     host avmlp-osd-019 
 18   hdd  1.99899         osd.18         
-41        1.99899     host avmlp-osd-020 
 19   hdd  1.99899         osd.19

Get actual map

This command export the map from the running cluster, the file is binary:

ceph osd getcrushmap  -o crushmap

Convert the map to text

crushtool  -d crushmap -o crushmap.txt

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 “node” define the child “nodes” with the item keyword.

Compile the new map

crushtool -c crushmap.txt -o crushmap.new

Apply the new map

ceph osd setcrushmap -i crushmap.new

Review the Map

ceph osd crush tree

Sample:

avmlp-osm-001 ~ :( # ceph osd crush tree 
ID  CLASS WEIGHT  TYPE NAME                      
 -1             0 root default                   
-44             0     datacenter itconic         
-43             0         rack datacenter01           
 -3       1.99899             host avmlp-osd-001 
  0   hdd 1.99899                 osd.0          
 -7       1.99899             host avmlp-osd-003 
  2   hdd 1.99899                 osd.2          
-11       1.99899             host avmlp-osd-005 
  4   hdd 1.99899                 osd.4          
-15       1.99899             host avmlp-osd-007 
  6   hdd 1.99899                 osd.6          
-19       1.99899             host avmlp-osd-009 
  8   hdd 1.99899                 osd.8          
-23       1.99899             host avmlp-osd-011 
 10   hdd 1.99899                 osd.10         
-27       1.99899             host avmlp-osd-013 
 12   hdd 1.99899                 osd.12         
-31       1.99899             host avmlp-osd-015 
 14   hdd 1.99899                 osd.14         
-35       1.99899             host avmlp-osd-017 
 16   hdd 1.99899                 osd.16         
-39       1.99899             host avmlp-osd-019 
 18   hdd 1.99899                 osd.18         
-48             0     datacenter mediacloud      
-47             0         rack datacenter02          
 -5       1.99899             host avmlp-osd-002 
  1   hdd 1.99899                 osd.1          
 -9       1.99899             host avmlp-osd-004 
  3   hdd 1.99899                 osd.3          
-13       1.99899             host avmlp-osd-006 
  5   hdd 1.99899                 osd.5          
-17       1.99899             host avmlp-osd-008 
  7   hdd 1.99899                 osd.7          
-21       1.99899             host avmlp-osd-010 
  9   hdd 1.99899                 osd.9          
-25       1.99899             host avmlp-osd-012 
 11   hdd 1.99899                 osd.11         
-29       1.99899             host avmlp-osd-014 
 13   hdd 1.99899                 osd.13         
-33       1.99899             host avmlp-osd-016 
 15   hdd 1.99899                 osd.15         
-37       1.99899             host avmlp-osd-018 
 17   hdd 1.99899                 osd.17         
-41       1.99899             host avmlp-osd-020 
 19   hdd 1.99899                 osd.19        

External documentation

ceph/modifying_crush_map.1563434264.txt.gz · Last modified: 2019/07/18 07:17 by 127.0.0.1