|
|
[root@compute01 ~]# ceph config help mon_max_pg_per_osd# q8 |: U& \/ c4 ]7 E: l
mon_max_pg_per_osd - Max number of PGs per OSD the cluster will allow
' Q* ^' c# s+ M; `7 x1 L; ` (uint, advanced)+ |0 R. A; b8 \+ ?9 a# U o
Default: 250
' G3 }2 V* [' r$ h$ G7 K' Z7 d Minimum: 1
5 a# s% H L# E$ ^- d9 ? Maximum:
9 Z9 o3 E9 N3 C! r2 t, m Can update at runtime: true
* ]/ F3 b* N/ D6 f# U4 W Services: [mgr]% F0 x+ s' z' J
If the number of PGs per OSD exceeds this, a health warning will be visible in `ceph status`. This is also used in automated PG management, as the threshold at which some pools' pg_num may be shrunk in order to enable increasing the pg_num of others.# y# N& P0 i+ c8 A
4 s+ @7 z- s) ^( p) T" M! ?( V. |( [0 S2 \: w
查看ceph的mon_max_pg_per_osd默认值:
! M: ?. c4 ?# n/ ^* hceph daemon mgr.`hostname -s` config get mon_max_pg_per_osd& `& J* I% j e: d/ y+ g
{! B( y) h7 l1 t5 i4 W* ?
"mon_max_pg_per_osd": "1000"
7 J5 K8 _+ n( l9 D}. s( p( t8 g: H2 N
( M+ u; i0 h1 [在线实时调整配置参数(重启后失效)
+ m+ E2 r" T) }8 x1 A+ v! w1 a1 q! J& m4 g$ Z: A0 H7 M
```
7 q- i" C2 J8 l6 z[root@ceph ~]# ceph daemon mgr.ceph1 config set mon_max_pg_per_osd 300
: y! ^1 s. L& [0 [6 ?! H{3 |! F+ ^: O g! X6 t% d
"success": "mon_max_pg_per_osd = '300' (not observed, change may require restart) "
$ g: ^# V& L2 N# j R5 w1 s}
3 W/ } Z0 c6 M- V8 n```
7 ~. m, y( X6 Y- v2 t5 I5 X2 M
3 A! O3 m) A3 @* I5 k- c* j
V7 w+ N9 ?6 M7 O& i- h- a$ v* [& ?$ ^, W: N0 r% i: i
启动保存配置: }2 ?: n' Q+ |7 m* U+ g, ^2 N6 c m
需要在/etc/ceph/ceph.conf加上以下内容
) v3 N U+ i1 c1 x0 f; y' Q! g! g; A! ` V- M9 H
```
% ]/ C) _9 ~0 {8 O& {7 a6 l0 h[mgr.ceph]
- V% W2 T8 ?- L7 W$ W1 ^. Ymon_max_pg_per_osd = 300
& R B: O2 p+ ?) ^+ S0 \7 U7 H```
% w8 \# z; V8 R% ?
! |: p7 B# h& L( e# k9 r6 J0 p% T8 m9 _7 x; c4 g
. V" f, s6 K' J; r6 c. y2 w |
|