找回密码
 注册
查看: 897|回复: 3

ceph 15.2版本pg autoscaler PG自动伸缩

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-1-9 08:29:39 | 显示全部楼层 |阅读模式
使能pg_autoscaler:
. F5 g8 N( ^/ w5 c0 yceph mgr module enable pg_autoscaler
" m: R0 u# f( D* C! M2 K查看PG自动伸缩状态:
* {' t* n# s2 P! Z  z% [3 f. i! v: x# c" L2 Y+ P. n
( `# s2 N: a, @. ~3 V6 D
设置PG自动伸缩:(ceph osd pool set pool_name pg_autoscale_mode on)
* [% {) V+ b. G+ \+ M/ ]) Q ceph osd pool set testpool pg_autoscale_mode on: c& s# N* [7 o" D9 I9 n5 H
ceph config set global osd_pool_default_pg_autoscale_mode <mode>, R3 H* B! y2 ]" I
' i. ^" ^/ h# v3 \1 z- M; e: I6 d' n$ b
如果您希望一个池相对于其他池消耗更多的集群容量,请使用 target_size_ratio 设置。  W8 S2 b3 Q& Q& n* J+ }& ~! h- y' P
可以使用target_size_ratio设置指定池的目标比率。如果您知道某个池相对于其他池应该具有一定的比率,则此设置特别有用。除非另有说明,否则每个池的目标比率默认应为 0。您给池的目标比率越高,您期望池中的 PG 就越大。
4 S  G; @4 R/ g. {1 s- b! J+ `
4 S) Z5 z6 G1 r- X# E
1 z0 Y+ \4 R# L* `& t8 r要检查池的目标比率,请使用osd pool autoscale-status并查看TARGET RATIO列。target_size_ratio可以使用ceph osd pool set <pool_name> target_size_ratio <ratio>进行调整。
* q2 j' E$ T$ u" Z0 {2 |# [ 要在创建池期间设置target_size_ratio,请使用ceph osd pool create --target-size-ratio <ratio>。0 ]+ j1 X9 M0 o# r0 a

3 Y7 R* E9 ?$ A' O  @使用 noautoscale 标志全局切换所有池的自动缩放器。
  }$ h' b5 R1 U( _现在可以为所有带有noautoscale标志的池全局打开和关闭自动缩放器。
4 Q% i" q& i( n( G& W  h默认情况下,此标志设置为 false,并且每个池的默认pg_autoscale模式(即 )on保持相同。/ d5 N, H' n( ?  q
* J+ H9 d+ ^. k9 T8 F1 k/ t
如果要为每个池打开自动缩放器,请使用ceph osd pool unset noautoscale。如果要为每个池关闭自动缩放器,请使用ceph osd pool set noautoscale。要获取 noautoscale 标志的当前值,请使用ceph osd pool get noautoscale。
" _* ~1 w/ \% h, ~
5 p1 q# G1 Q$ u3 X# b6 {使用bias来帮助自动缩放器准确调整 PG 的数量。
2 T; P- q4 I, l偏差是一个乘数,用于根据有关该池的预期 PG 数量的信息手动调整池的 PG。默认情况下,偏差值应为 1.0,除非另有说明。你给池的偏差越大,你期望池中的 PG 就越大。
) A' z0 u0 |7 b8 m' f1 ~! u9 c& G' Q9 Z) x: `1 \
要检查池中的bias值,请使用osd pool autoscale-status并查看BIAS列。要在现有池上设置bias ,请使用ceph osd pool set <pool_name> pg_autoscale_bias <bias>。
' t/ y/ ~3 @( V* i: @; j" k4 \( G- [5 F1 B0 e* h- f
如果您提前知道池的使用率,请在创建池之前使用 pg_num 选项。
- t- o% K" s, g首次创建集群或池时,仅消耗一小部分集群容量。因此,您的系统可能会低估集群或池所需的 PG 数量。如果您提前知道集群或池的使用率,请在创建池之前使用该pg_num选项。这将帮助您的集群提前计入适当数量的 PG。
5 y' x/ @; C* A  B/ [- o( R; t% Q
要检查池的pg_num值,请使用ceph osd pool autoscale-status并查看PG_NUM列。要指定创建池时设置pg_num,请使用ceph osd pool create <pool_name> <pg_num>。要设置池中允许的最小 pg 数,请使用ceph osd pool set <pool-name> pg_num_min <pg_num>。 要设置池中允许的最大 pg 数,请使用ceph osd pool set <pool-name> pg_num_max <pg_num>。  h0 C& [( M5 X' A9 y
/ o. z# e" M* {$ Q5 _
使用 pg_num_max 值设置池中的最大 PG 数。
8 T+ L5 g0 G7 T可以指定池中的最大 PG 数。这在创建较小的池(例如 .mgr、元池或不带--bulk标志的池)时很有用。
4 [- I2 D/ H/ n  Q! @* e9 ?# S
; Q9 q+ u0 S) N/ g4 l# ]要在创建池时指定最大 PG 计数,请在命令中使用可选--pg-num-max <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_max <num>进行设置。7 {  Z2 k  B3 X  C% e
3 |) F9 e# b9 Y* A1 T
使用 pg_num_min 值设置池中的最小 PG 数。/ K% d" z4 v4 \9 Z. i, P# ~% d3 P
同样,我们可以指定一个池中的最小 PG 数。当我们想要客户端在执行 IO 时看到的并行量的下限时,这是有利的,即使池大部分是空的。这在创建更大的池(例如设置了--bulk标志的池)时很有用。; e1 N4 z& L3 c3 P5 v7 T

* @7 d0 U9 h; {; D. g8 N7 }要在创建池时指定最小 PG 计数,请在命令中使用可选--pg-num-min <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_min <num>进行设置。
" W4 G$ b- S" c8 V! [" U; ^% J" d2 A; w& q2 o. k! A7 p& k
1 M, ]- j7 S/ n5 H: L
设置目标ratio:  E- A0 M/ A. A( ~7 {- I2 G& G. _
ceph osd pool set volumes target_size_ratio .8
) g% A+ l7 H( N& v# k查看是否开启:
( T4 ~2 e% h, i' p% B& j# h  A* E* R

: s8 Z% H# h' J) ~7 U1 K7 X+ |. J" e
& x; |7 e: H+ a8 Z' h2 C/ s8 p
9 R. k/ Y" E. ~: p: g5 t0 [
: v% p8 q4 N; l: S3 k4 |
: {, i1 r9 Z$ `1 }

' Q% V, ?! x: u3 e: W0 [

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:05:26 | 显示全部楼层
关闭自动伸缩:
+ \( v: z- Z+ \ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off
1 c. ^( e( |" q* ^- G! D- _set pool 6 pg_autoscale_mode to off
$ I. d* q- c7 {7 J; Q, x; q开启自动伸缩:, T1 ~) J5 N5 X- y: O8 e4 l! ^0 t  P) O$ b+ Y
[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on2 E; Q) t/ ?) U2 Q# h
set pool 6 pg_autoscale_mode to on" i5 U( |, C( k
$ ?0 w+ a$ q& c
7 n, D" l& @$ _2 x
[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off
: @8 d! N5 X- x' C$ @$ Kset pool 6 pg_autoscale_mode to off% x% g/ [$ d8 @& u  I$ N- i$ n% S
[root@ceph1 ~]# ceph osd pool ls detail 8 @- O' @& L5 K3 z) Y/ m6 B
pool 1 'device_health_metrics' replicated size 2 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 375 flags hashpspool,selfmanaged_snaps stripe_width 0 pg_num_min 1 application mgr_devicehealth$ ?3 E0 _/ _( r( A$ I4 b4 \& r9 O6 K
pool 2 '.rgw.root' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 35 flags hashpspool stripe_width 0 application rgw/ q& i( M+ c1 [
pool 3 'default.rgw.log' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 37 flags hashpspool stripe_width 0 application rgw* O0 O  D  e* P- ^- u
pool 4 'default.rgw.control' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 39 flags hashpspool stripe_width 0 application rgw
+ F9 U$ h" w/ f8 r2 P. M2 Gpool 5 'default.rgw.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 autoscale_mode on last_change 156 lfor 0/156/154 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw
$ {: P* N1 q% ^& T; q6 }# E$ Bpool 6 'cephfs.cephfs.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode off last_change 376 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 16 recovery_priority 5 application cephfs3 Q2 i* k( b9 q! S2 z+ p
pool 7 'cephfs.cephfs.data' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 163 flags hashpspool stripe_width 0 application cephfs
8 N- ^0 P! {2 tpool 8 'default.rgw.buckets.index' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 autoscale_mode on last_change 297 lfor 0/297/295 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw" @- j! m* U+ c* S/ d+ E
) m) Q- @- r  S" r, L
[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on
- A7 E* a! b0 K4 V2 t0 eset pool 6 pg_autoscale_mode to on: G8 `0 E- M, D# Z) r
[root@ceph1 ~]# ceph osd pool ls detail
9 n' F4 C' H! h5 z% z; a, C; e* ypool 1 'device_health_metrics' replicated size 2 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 375 flags hashpspool,selfmanaged_snaps stripe_width 0 pg_num_min 1 application mgr_devicehealth" h3 n! }* A* B5 W5 |9 O  c* U
pool 2 '.rgw.root' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 35 flags hashpspool stripe_width 0 application rgw8 s. T$ W! U! L
pool 3 'default.rgw.log' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 37 flags hashpspool stripe_width 0 application rgw" J" v9 B# n% ]# N  P; Q; _7 s
pool 4 'default.rgw.control' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 39 flags hashpspool stripe_width 0 application rgw0 u# M/ T+ H) d3 t& K
pool 5 'default.rgw.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 autoscale_mode on last_change 156 lfor 0/156/154 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw
$ m& e( @5 r- G, ?* \) Ipool 6 'cephfs.cephfs.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 377 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 16 recovery_priority 5 application cephfs+ N" s; H+ [+ W& w! u1 l7 M
pool 7 'cephfs.cephfs.data' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 163 flags hashpspool stripe_width 0 application cephfs$ {0 N+ `6 N  r7 A) h2 X6 l
pool 8 'default.rgw.buckets.index' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 autoscale_mode on last_change 297 lfor 0/297/295 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw
8 H& Q1 ~! h1 a$ a6 p6 n& g
3 |. M* X  h" W+ C1 U# T5 [7 s  X. ^

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:07:39 | 显示全部楼层
调整pool的pg数之后我们观察到的变化如下:! b4 N0 H: r% W" v- D+ `2 j2 S
[root@ceph1 ~]# ceph osd pool set default.rgw.meta pg_num 64
" c" C9 c' S5 Mset pool 5 pg_num to 64
) q6 Y* ^$ g5 r5 O4 W+ K6 W[root@ceph1 ~]# ceph osd pool set default.rgw.meta pgp_num 64
" e" L9 a+ L! V8 h  @. J* Wset pool 5 pgp_num to 64" L, T" D6 a$ v% G% M

; L% x) P  ?) D  U此时的状态:7 v0 k7 a6 c( M1 V. x4 w- I
[root@ceph1 ~]# ceph -s# u/ [; t! [; p
  cluster:
: }! ~/ @/ _1 S    id:     433d3d2a-8e4a-11ed-b84b-000c29377297
* c7 q- i7 y5 g( Z    health: HEALTH_OK9 L* W' ?3 v, g. C; ?8 z

5 B, Y% A+ W/ ?- Z% M/ S/ [+ N  services:
' }4 J0 e" g$ i2 a( f- c1 r3 K* I    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 4m)
& `: M) W9 ?' j    mgr: ceph2.twhubv(active, since 3m), standbys: ceph1.zmducz, ceph3.dkkmft, G' |' q- L( e4 O2 @! k+ S
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
6 P7 n7 O" [, k% X; i/ r( W    osd: 3 osds: 3 up (since 3m), 3 in (since 11h), a- k& J! l4 D( |3 _# @( v' d" B
    rgw: 3 daemons active (ceph1, ceph2, ceph3)$ B. y( m$ j  o$ m8 b
  `6 K3 U9 k: K9 E$ w: L
  task status:
5 `5 J7 H. i# i: c+ B
% d" w: b5 Q" y5 e/ q' C% k  data:: s( R3 `+ R4 J: S" q+ v
    pools:   8 pools, 233 pgs. w: ^, b% z, T+ F
    objects: 240 objects, 157 KiB
3 G! q+ M" M$ g( E& w6 r2 q: A3 P    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
! \( h# N# ?8 v$ C5 v    pgs:     233 active+clean
' u9 S; `: _7 z/ b. ^% \1 _8 p. p
$ ^: b- G; d1 t+ g+ v

! d+ n6 C: R  N( o8 l/ M1 C7 K6 j1 q! x" W6 D
pgs到达某个值:
7 V# @6 _: I2 ~" u% v
. X0 y1 w4 e- [5 a8 L* k+ b' l, [. r( Q" ~/ f
查看pool池的详细记录:; {, k* I( _1 I6 R3 B+ j
1 u0 E( Q: y5 U8 ~) m' R
[root@ceph1 ~]# ceph osd pool ls detail
' i' m8 H7 D0 O( e% ]8 Q3 upool 1 'device_health_metrics' replicated size 2 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 375 flags hashpspool,selfmanaged_snaps stripe_width 0 pg_num_min 1 application mgr_devicehealth' ^7 S3 U7 M2 s" \2 ?( X0 P* l5 A
pool 2 '.rgw.root' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 35 flags hashpspool stripe_width 0 application rgw
8 q/ ?- s, D2 H! Ipool 3 'default.rgw.log' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 37 flags hashpspool stripe_width 0 application rgw
) P) A4 X' _1 q- wpool 4 'default.rgw.control' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 39 flags hashpspool stripe_width 0 application rgw2 s+ ?1 I) m8 E" O7 \% l) w5 [
pool 5 'default.rgw.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 64 pgp_num 64 autoscale_mode on last_change 381 lfor 0/156/379 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw; q+ P6 v# T# a
pool 6 'cephfs.cephfs.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 377 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 16 recovery_priority 5 application cephfs
/ _9 ], X- w3 w# ~2 `, R$ Jpool 7 'cephfs.cephfs.data' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 163 flags hashpspool stripe_width 0 application cephfs
& y" b# x' \' A6 i6 Kpool 8 'default.rgw.buckets.index' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 autoscale_mode on last_change 297 lfor 0/297/295 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw2 @5 p: ]1 ^' H0 f1 {* a

7 {- H& T3 X- x& m. Q8 O1 _4 s发生变化,pg开始下降:
8 e) @) M$ C" h+ ]/ w% x( a[root@ceph1 ~]# ceph osd pool ls detail
4 v) @4 p! I- a; n9 N( r  Fpool 1 'device_health_metrics' replicated size 2 min_size 1 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 375 flags hashpspool,selfmanaged_snaps stripe_width 0 pg_num_min 1 application mgr_devicehealth
: ]! h+ H8 e) w6 R$ r* f, o5 apool 2 '.rgw.root' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 35 flags hashpspool stripe_width 0 application rgw
- f2 w' c( `3 d5 Bpool 3 'default.rgw.log' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 37 flags hashpspool stripe_width 0 application rgw
' k- R* k3 |. U, n; \pool 4 'default.rgw.control' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 39 flags hashpspool stripe_width 0 application rgw
7 j$ ~9 A0 l$ b& ?: \pool 5 'default.rgw.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 61 pgp_num 59 pg_num_target 8 pgp_num_target 8 autoscale_mode on last_change 400 lfor 0/400/398 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw: r  K9 O- {; p! f. @- R: v
pool 6 'cephfs.cephfs.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 377 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 16 recovery_priority 5 application cephfs' y# x9 g$ z0 I0 E7 V
pool 7 'cephfs.cephfs.data' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 163 flags hashpspool stripe_width 0 application cephfs
8 x. \6 s! }9 y. T6 ^pool 8 'default.rgw.buckets.index' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 autoscale_mode on last_change 297 lfor 0/297/295 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 8 application rgw
8 v* I0 E- o, `, T
, S/ @3 @% ?- p: \1 L- M状态pgs也在下降:
: u0 D' t5 z) U5 B; M[root@ceph1 ~]# ceph -s
) E  O5 `  a+ B1 b4 r! Q9 j% H  cluster:
1 L5 R$ f4 i4 C  [. v( Y    id:     433d3d2a-8e4a-11ed-b84b-000c293772978 ^4 J. i! A1 S1 T
    health: HEALTH_OK! v9 z; Y' O5 ]5 q4 E7 H  i

5 j; w4 F0 f/ I. }6 J% x" b  services:
' t, }: e' y9 g/ c: D* [    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
! U7 G) q& ~; x% l* Q8 {; i0 A    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft. `) P: o+ U- |( \' Q
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
" o& O- `) r  V    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
& l2 ?( z8 q) l  T6 A: m    rgw: 3 daemons active (ceph1, ceph2, ceph3)
6 Q1 W3 K* P6 H$ t* U* C, S5 U - d, i. u8 }4 ]* e5 |3 M
  task status:
9 b. h/ @' ?! g. i6 h
6 |' W% n7 w0 p* j8 n: A7 h  data:
" }( v6 J1 Y7 @) {1 H    pools:   8 pools, 228 pgs8 I4 ?4 ]/ u  j4 S
    objects: 240 objects, 157 KiB
1 ~3 m" O  ]3 m1 n* U/ f    usage:   3.0 GiB used, 57 GiB / 60 GiB avail! q8 g, \' O3 U0 d- d2 u
    pgs:     228 active+clean
; l3 E9 V1 N* _) X, n9 e1 B
2 h. i! e0 Y" |6 `* ~# |  progress:
' Z  k* g% c) c" @$ e! `, M1 }# P    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)
1 Y& u# O+ p1 K* W: ?      [............................] 8 J- c- N& B% l3 |' p, ^

; `5 Q8 n3 c5 k& \9 e( Z[root@ceph1 ~]# ceph -s
9 I2 V) j8 Z  K3 p1 ^. t: J  cluster:
- g5 }0 D5 l/ J( T6 n    id:     433d3d2a-8e4a-11ed-b84b-000c293772974 G2 p/ F0 ^6 F; |$ a+ f
    health: HEALTH_OK* `6 P9 A2 j6 r0 s0 @+ I, C/ s
$ g' i3 m- h& _9 R, e3 P. O
  services:5 |7 u6 f7 G) S$ B) y
    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
- l2 I7 O0 j9 r" B9 k# J8 z3 I    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft# _$ Y! V* K% d# a) j1 E
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
7 K/ M8 h+ ~; M$ F    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
5 N0 e$ b( G+ _    rgw: 3 daemons active (ceph1, ceph2, ceph3)2 I0 n- V) V" w- p) N* X0 u- j
( u7 E5 M( _+ Y  P, f
  task status:
" t  e' `+ q9 g " y, k2 U* [+ R2 P* b
  data:
* V' ~0 N9 U: O3 s8 W4 E    pools:   8 pools, 228 pgs
$ a0 s8 ^) r# _  r4 {0 S    objects: 240 objects, 157 KiB* G2 f2 q/ a6 F; N0 z1 s
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
( a+ y' H+ P& L9 }( R" C9 n* @    pgs:     228 active+clean9 `* [! z# @+ X; \8 h+ [
# D0 E3 q, S- C# U& A
  progress:
% Z: E3 R1 |  K0 {5 t' l    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)
$ e4 ]2 Q% o: }/ M5 g0 g7 a      [............................] . e3 A6 ~6 q3 B- t. }7 r

6 C9 q- @( l4 R- K) H) I7 s4 k
. p+ A3 i( @; p" ~3 E) i8 B. b5 H5 ^
等待同步一会7 @2 v. @9 v9 s. Y+ X3 Z" ?
[root@ceph1 ~]# ceph -s
  m8 y9 b3 \' G* k  cluster:3 P# f/ R# O7 K% _$ @! O7 Q
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297
& c3 W0 K2 P! G9 R3 b+ N4 W$ Z    health: HEALTH_OK: l& z; i1 z) e4 d1 z7 m4 ^
) O: F+ |) J( K2 p6 _3 a
  services:, M; i1 X7 D& Q% \/ L% N
    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 10m)
8 o9 t' A; l9 l7 @+ C4 r' {    mgr: ceph2.twhubv(active, since 9m), standbys: ceph1.zmducz, ceph3.dkkmft
5 V# C! D& \& ^, r5 d2 O    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby2 D/ }  [; K8 `$ e1 \
    osd: 3 osds: 3 up (since 9m), 3 in (since 11h)5 \  j& w  C9 l5 e5 v# r
    rgw: 3 daemons active (ceph1, ceph2, ceph3)
) t' b/ b+ M" N1 {
; j; D  t' v0 [( k- c, I  task status:* ~1 l; X) H/ R8 f- U
4 d' K% |5 d2 E) \
  data:0 ~8 p) u( n, U9 o8 U
    pools:   8 pools, 185 pgs. s( x1 W1 K3 j$ D
    objects: 240 objects, 157 KiB0 \* `. w) H2 E  n2 @
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
2 u9 f" B0 r+ ]* `0 `  O    pgs:     185 active+clean
; U8 m7 M2 R1 Y  n: ^- y. o) e. t( V, L3 D& M: G
  progress:
! T, }/ W) ~- ^& C    PG autoscaler decreasing pool 5 PGs from 64 to 8 (5m)
- F; x3 s8 \: d4 E1 d6 F) [& ^      [======================......] (remaining: 81s)
9 n9 e2 L) B( `9 f. G, R( R* D/ y# t( b! j) _+ V
自动下降到185。因为是虚机下降速度较慢。
9 t2 P/ U$ l) u) R- F

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:37:11 | 显示全部楼层
[root@ceph1 ~]# ceph osd pool autoscale-status
2 K* Z6 h$ A- w7 C) jError ENOTSUP: Module 'pg_autoscaler' is not enabled (required by command 'osd pool autoscale-status'): use `ceph mgr module enable pg_autoscaler` to enable it
# e- O1 R4 X, _; F: Z3 A( Q6 t[root@ceph1 ~]# ceph mgr module enable pg_autoscaler$ \; ?* w- Y9 @3 R1 p7 \
[root@ceph1 ~]# ceph osd pool autoscale-status 5 y" O  ~7 Z. g! S* [. a
POOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE
6 d2 H/ c( W2 Ddefault.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      $ Z3 F2 s, u; M5 P, M" r3 l
default.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      + O+ F: {) p1 X2 C1 A) [
.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      & y  }. ^) Y4 m* J' E4 ]
ocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      
6 C& a1 b4 g5 I$ X: @. N! Smetadata             7775               2.0        1799G 0.0000                               4.0     32            warn      
" v6 M. j8 r! d/ b5 c2 R  Fdefault.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      : ?) I! V/ a6 ]; o$ x) `7 @
cephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      0 c( T& W- c( h* ^5 X
[root@ceph1 ~]# ceph osd pool autoscale-status
. q" ^% _, y3 C& P, L$ d" U; ]% TPOOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE
9 t1 P: }: y) u# hdefault.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      
$ b  }8 g0 m4 t) ^3 f/ r4 E7 ^default.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      
. T" m- q1 [/ W+ S.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      
$ S; Q/ W4 ^' Bocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      7 T, W! o5 e; ]; N1 Y! M
metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      % `' }/ t9 _' t
default.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      
1 X7 O' k- p* ~' Z0 y, `cephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      1 @6 z& v) \  R4 F# ]& i
: ]9 X7 z6 c9 J' T& o* N9 {

; Z3 w' w- G- S& }  v" Y2 g* z3 g3 J; X2 g* J7 \8 a

( V, T+ Y2 o( \/ `+ l: I' H% T设置目标ratio:# `7 e! [- c6 i# @, z0 ?/ j  a
ceph osd pool set volumes target_size_ratio .8& s, \5 B7 u  u0 V0 w6 F

. s: J7 [. y( N6 ?6 a- M3 A查看是否开启
) l' L. U# z6 z4 s: D[root@ceph1 ~]# ceph osd pool autoscale-status & W: A# d8 t7 Q. q5 ^: D
POOL                         SIZE  TARGET SIZE  RATE  RAW CAPACITY   RATIO  TARGET RATIO  EFFECTIVE RATIO  BIAS  PG_NUM  NEW PG_NUM  AUTOSCALE  
0 r6 m$ C2 ^0 j0 C" kdevice_health_metrics         19                 2.0        61428M  0.0000                                  1.0       1              on         
2 R4 Z4 j/ y% f, {. Q) |.rgw.root                   2110                 3.0        61428M  0.0000                                  1.0      32              on         
" m% s! ]' c: m# B! d) ddefault.rgw.log             3583                 3.0        61428M  0.0000                                  1.0      32              on         
! W2 {$ s4 z& {. }8 Ldefault.rgw.control            0                 3.0        61428M  0.0000                                  1.0      32              on         - W' j, v( N1 [+ p
default.rgw.meta             829                 3.0        61428M  0.0000                                  4.0       8              on         
5 E, Q/ T3 S# V9 Zcephfs.cephfs.meta         72392                 3.0        61428M  0.0000                                  4.0      16              on         9 Y2 R/ l% {6 _3 E1 x
cephfs.cephfs.data         131.2k                3.0        61428M  0.0000                                  1.0      32              on         6 Z+ _6 k3 _* u& _5 Y  Y! P
default.rgw.buckets.index  96810                 3.0        61428M  0.0000                                  4.0       8              on      
5 t* _: z+ X$ ^- K6 j  h
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-11 23:05 , Processed in 0.015911 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表