YUMSERV
반응형

Crushmap을 수동으로 편집할 수 있습니다.

기존에 있는 CRUSHMAP을 수정하려면 아래와 같은 절차로 진행하면 됩니다.


현재 있는 crushmap 가져오기

# ceph osd getcrushmap -o [compiled crushmap]

[root@mgmt ~]# ceph osd getcrushmap -o /tmp/crushmap

got crush map from osdmap epoch 23


CRUSHMAP decompile

# crushtool -d [compiled crushmap] -p [decompiled crushmap]

[root@mgmt ~]# crushtool -d /tmp/crushmap -o /tmp/crushmap.txt


[root@mgmt ~]# cat /tmp/crushmap.txt

# begin crush map

tunable choose_local_tries 0

tunable choose_local_fallback_tries 0

tunable choose_total_tries 50

tunable chooseleaf_descend_once 1

tunable chooseleaf_vary_r 1

tunable straw_calc_version 1


# devices

device 0 osd.0

device 1 osd.1


# types

type 0 osd

type 1 host

type 2 chassis

type 3 rack

type 4 row

type 5 pdu

type 6 pod

type 7 room

type 8 datacenter

type 9 region

type 10 root


# buckets

host osd-0 {

id -2 # do not change unnecessarily

# weight 0.019

alg straw

hash 0 # rjenkins1

item osd.0 weight 0.019

}

host osd-1 {

id -3 # do not change unnecessarily

# weight 0.019

alg straw

hash 0 # rjenkins1

item osd.1 weight 0.019

}

root ssd {

id -4 # do not change unnecessarily

# weight 0.039

alg straw

hash 0 # rjenkins1

item osd-0 weight 0.019

item osd-1 weight 0.019

}

root default {

id -1 # do not change unnecessarily

# weight 0.039

alg straw

hash 0 # rjenkins1

item ssd weight 0.039

}


# rules

rule replicated_ruleset {

ruleset 0

type replicated

min_size 1

max_size 10

step take default

step chooseleaf firstn 0 type host

step emit

}

rule ssd {

ruleset 1

type replicated

min_size 1

max_size 10

step take default

step chooseleaf firstn 0 type host

step emit

}

# end crush map


수정 된 내용

[root@mgmt ~]# cat /tmp/crushmap.txt 

# begin crush map

tunable choose_local_tries 0

tunable choose_local_fallback_tries 0

tunable choose_total_tries 50

tunable chooseleaf_descend_once 1

tunable chooseleaf_vary_r 1

tunable straw_calc_version 1


# devices

device 0 osd.0

device 1 osd.1


# types

type 0 osd

type 1 ssd_osd

type 10 root


# buckets

ssd_osd osd-0 {

id -11 # do not change unnecessarily

# weight 0.019

alg straw

hash 0 # rjenkins1

item osd.0 weight 0.019

}

ssd_osd osd-1 {

id -12 # do not change unnecessarily

# weight 0.019

alg straw

hash 0 # rjenkins1

item osd.1 weight 0.019

}

root ssd {

id -10 # do not change unnecessarily

# weight 0.039

alg straw

hash 0 # rjenkins1

item osd-0 weight 0.019

item osd-1 weight 0.019

}

root default {

id -1 # do not change unnecessarily

# weight 0.039

alg straw

hash 0 # rjenkins1

item ssd weight 0.039

}


# rules

rule ssd {

ruleset 0

type replicated

min_size 1

max_size 10

step take ssd

step chooseleaf firstn 0 type ssd_osd

step emit

}


# end crush map


수정된 CRUSHMAP 적용
[root@mgmt ~]# crushtool -c /tmp/crushmap.txt -o /tmp/crushmap-new.bin
[root@mgmt ~]# crushtool -c /tmp/crushmap.txt -o /tmp/crushmap.coloc
[root@mgmt ~]# ceph osd setcrushmap -i /tmp/crushmap.coloc 
set crush map




반응형

'BlockStorage(Ceph)' 카테고리의 다른 글

CEPH OSD 제거  (2) 2020.06.29
CEPH MON 추가(수동)  (0) 2020.06.27
CEPH pool, crush rule, bucket 생성  (0) 2020.06.08
CEPH 설치  (0) 2020.05.31
CEPH 설치 전 사전작업  (0) 2020.05.31
profile

YUMSERV

@lena04301

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!