|
|
[root@compute01 ~]# ceph config help mon_max_pg_per_osd
, q2 J. f b& j+ u, I# d) i! Tmon_max_pg_per_osd - Max number of PGs per OSD the cluster will allow. i4 Z' t" F, x: |
(uint, advanced)! q( F; C+ U' u4 a
Default: 2507 |& o$ e; a6 l, _! f# j
Minimum: 1
. E( D6 M1 O+ p' i- T& A Maximum: 6 \, A: A+ k8 Z9 D
Can update at runtime: true) [% C' E& P5 S" R
Services: [mgr]
& t# P: o" k$ C* pIf 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.
" L( R, ?# T+ A& V# r7 B$ l2 D) G' z( K, ^4 d& y7 |6 Z* a
& ?/ K& U, H$ I查看ceph的mon_max_pg_per_osd默认值:! f; X$ [2 j2 m0 J1 a2 O( C3 T
ceph daemon mgr.`hostname -s` config get mon_max_pg_per_osd
" R* w u$ v$ M: R2 i1 `. _- J) {{
: _" O) } \9 J& A$ Y "mon_max_pg_per_osd": "1000"
" e+ v. P7 Z" U7 n! S0 W3 N9 N}4 _6 n, p8 V h7 Y, r9 Y4 U$ O2 N
6 e+ e' p& M- ^. ]/ e1 e& l! Z在线实时调整配置参数(重启后失效)
' o( m) k' x/ q) d; a3 a o# v! \2 R5 t/ `" s. b7 f
```8 A. c" | X+ ~' s4 p
[root@ceph ~]# ceph daemon mgr.ceph1 config set mon_max_pg_per_osd 300
0 D3 i. R$ L( @) f( O{
# Y% @# D# R* c" M9 r! I% G/ J- M; O "success": "mon_max_pg_per_osd = '300' (not observed, change may require restart) "
6 P2 m7 t; `' m% K" Y}
0 H7 o/ F* l/ O& _! I: F* Y```
& k" S4 V" y3 }* f0 |* c
: z4 R7 u K# f3 @9 K0 Q0 a: R% ^; c
& W7 N# o7 E5 a$ ]* `4 d* f) F4 K6 W2 _9 r& O
启动保存配置; a% }. B8 V0 G/ B$ d0 t$ ?
需要在/etc/ceph/ceph.conf加上以下内容
& I) ~# m5 \: X9 ?9 R, r" D$ G: N9 U5 O7 Q
```
6 F9 s- G- K+ [: ~$ f[mgr.ceph]% c& u# q+ J b3 h5 x* k: [: ~
mon_max_pg_per_osd = 300# I! n2 G( |3 T$ q( q
```, y+ W, {! Z1 h; U( ~
3 x; G$ X4 Y/ {8 I" h6 u
- u+ `5 d2 s% S1 j* ?! s8 t X* A) ?' m6 [" X% s
|
|