User Tools

Site Tools


ceph:modifying_crush_map

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ceph:modifying_crush_map [2019/07/18 07:17] – external edit 127.0.0.1ceph: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:| How to modify CRUSH map  | 
-^Modification date :|11/06/2019| 
-^Owner:|dodger@ciberterminal.net| 
-^Notify changes to:|Owner| 
-^Tags:| ceph, object storage| 
- 
- 
-====== Information ====== 
-<WRAP center round alert 60%> 
-The described process is a advanced process, take care. 
-</WRAP> 
- 
-====== 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 
-</code> 
- 
-Example: 
-<code> 
-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 
-</code> 
- 
- 
-===== Get actual map ===== 
-This command export the map from the running cluster, the file is **binary**: 
-<code bash> 
-ceph osd getcrushmap  -o crushmap 
-</code> 
- 
-===== Convert the map to text ===== 
-<code bash> 
-crushtool  -d crushmap -o crushmap.txt 
-</code> 
- 
-===== 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  | <code> 
-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 
-} 
-</code> | 
-^ datacenter | <code> 
-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 
-} 
-</code> | 
- 
-So each "node" define the child "nodes" with the ''item'' keyword. 
- 
- 
- 
-===== Compile the new map ===== 
- 
-<code bash> 
-crushtool -c crushmap.txt -o crushmap.new 
-</code> 
- 
- 
-===== Apply the new map ===== 
- 
-<code bash> 
-ceph osd setcrushmap -i crushmap.new 
-</code> 
- 
-===== Review the Map ===== 
-<code bash> 
-ceph osd crush tree 
-</code> 
- 
-Sample: 
-<code> 
-avmlp-osm-001 ~ :( # ceph osd crush tree  
-ID  CLASS WEIGHT  TYPE NAME                       
- -1             0 root default                    
--44                 datacenter itconic          
--43                     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                 datacenter mediacloud       
--47                     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         
-</code> 
- 
-====== External documentation ====== 
- 
-  * [[http://www.sebastien-han.fr/blog/2012/12/07/ceph-2-speed-storage-with-crush/]] 
-  * [[https://swamireddy.wordpress.com/2016/01/16/ceph-crush-map-for-host-and-rack/]] 
  
ceph/modifying_crush_map.1563434264.txt.gz · Last modified: 2019/07/18 07:17 by 127.0.0.1