阅读814 返回首页    go 阿里云 go 技术社区[云栖]


Ceph实验室:第八课:查看Ceph CRUSH map

查看CRUSH map

  • 从monitor节点上获取CRUSH map


[root@ceph ceph]# ceph osd getcrushmap -o crushmap_compiled_file

  • 反编译CRUSH map


[root@ceph ceph]# crushtool -d crushmap_compiled_file -o crushmap_decompiled_file

  • 修改完成后,我们需要编译他


[root@ceph ceph]# crushtool -d crushmap_decompiled_file -o newcrushmap

  • 将新CRUSH map导入集群中


[root@ceph ceph]# ceph osd setcrushmap -i newcrushmap



[root@ceph ceph]# cat crushmap_decompiled_file
# 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
device 2 osd.2

# 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 ceph-node1 {
	id -2		# do not change unnecessarily
	# weight 0.000
	alg straw
	hash 0	# rjenkins1
}
host ceph {
	id -3		# do not change unnecessarily
	# weight 0.044
	alg straw
	hash 0	# rjenkins1
	item osd.2 weight 0.015
	item osd.1 weight 0.015
	item osd.0 weight 0.015
}
root default {
	id -1		# do not change unnecessarily
	# weight 0.044
	alg straw
	hash 0	# rjenkins1
	item ceph-node1 weight 0.000
	item ceph weight 0.044
}

# 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
}

# end crush map


最后更新:2017-04-08 00:29:58

  上一篇:go 同时支持mybatis,hibernate等技术的通用持久层实现思路
  下一篇:go Ceph实验室:第七课:Ceph块存储操作