Numerical adjustment of ceph osd weight and reweight
1. Introduction
After the ceph cluster is successfully built, many times the pg distribution is uneven, so we need to manually adjust the weight value to achieve the relative balance of pg (this article is for people with ceph foundation, so the command will not explain)
# ceph osd treeID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF-1 0.20181 root default-7 0.05499 host mon0 0 hdd 0.01799 osd.0 up 1.00000 1.00000 1 hdd 0.01799 osd.1 up 1.00000 1.00000 2, weight value adjustment
Weight represents the weight of osd, 1 = 1TB; the pg distribution can be adjusted by adjusting the weight value; it should be noted that the equivalent relationship with capacity is only considered to be quantified as a measure for crush calculation.
2.1 Adjustment Command # ceph osd crush reweight {name} {float [0.0-1]} 2.1 estimate pg Distribution # osdmaptool implement estimation of pg Distribution # osdmaptool / tmp/osdmap-- test-map-pgs-- import-crush {crushmap} 3, reweight value adjustment
Reweight stands for percentage matching on the basis of weight
3.1 adjust the command # ceph osd reweight-by-utilization {avr_num} {float} {osd_num} [--no-increasing] # ceph osd reweight-by-pg {avr_num} {float} {osd_num} [[pool1].. [poolN]] 3.2 estimated change # ceph osd test-reweight-by-utilization {avr_num} {float} {osd_num} [--no-increasing] # ceph osd test-reweight-by-pg {avr_num} {float} {osd_num} [[pool1]. [poolN]]