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

ceph 15.2版本pg autoscaler PG自动伸缩

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-1-9 08:29:39 | 显示全部楼层 |阅读模式
使能pg_autoscaler:8 n, y( k8 h$ u7 R
ceph mgr module enable pg_autoscaler
7 M8 b0 V4 s! Q( H. T" N6 M& r. s查看PG自动伸缩状态:) w$ Z0 t( G" M& `
* ~" V' E6 L6 v- E

0 P) N: l' }# G  C) d' X设置PG自动伸缩:(ceph osd pool set pool_name pg_autoscale_mode on)* F' W! ^( ^$ d4 ^- a1 ?
ceph osd pool set testpool pg_autoscale_mode on( Z5 I' Y* W1 v8 l
ceph config set global osd_pool_default_pg_autoscale_mode <mode>
$ E) A% W- v5 r& z! j) H$ ~7 f
' s! e* _6 ^( i5 L2 g7 W- @如果您希望一个池相对于其他池消耗更多的集群容量,请使用 target_size_ratio 设置。
' r/ x; i8 V7 J. o可以使用target_size_ratio设置指定池的目标比率。如果您知道某个池相对于其他池应该具有一定的比率,则此设置特别有用。除非另有说明,否则每个池的目标比率默认应为 0。您给池的目标比率越高,您期望池中的 PG 就越大。. [" e/ C, w/ j' ]
5 f& @2 U0 i% S  m  @! U4 {6 x) S
/ n* M' \3 `# k7 x' h  Z
要检查池的目标比率,请使用osd pool autoscale-status并查看TARGET RATIO列。target_size_ratio可以使用ceph osd pool set <pool_name> target_size_ratio <ratio>进行调整。
) B3 U4 }( M, \' M; y: m9 b 要在创建池期间设置target_size_ratio,请使用ceph osd pool create --target-size-ratio <ratio>。
" r, y; c7 E- U, M5 w0 J* ^! M6 q& F6 w2 h2 l
使用 noautoscale 标志全局切换所有池的自动缩放器。
+ ^* M: g6 [2 H! E: @现在可以为所有带有noautoscale标志的池全局打开和关闭自动缩放器。+ f5 ^* C3 q$ b% ^
默认情况下,此标志设置为 false,并且每个池的默认pg_autoscale模式(即 )on保持相同。
7 m0 |, {6 f8 k) ?( f9 ^5 K. E
$ U8 e3 h1 x5 C7 o2 D. g如果要为每个池打开自动缩放器,请使用ceph osd pool unset noautoscale。如果要为每个池关闭自动缩放器,请使用ceph osd pool set noautoscale。要获取 noautoscale 标志的当前值,请使用ceph osd pool get noautoscale。
: |8 K2 {9 t1 h
7 u. \& C. u2 c8 y, g5 B9 u使用bias来帮助自动缩放器准确调整 PG 的数量。  H8 n. u- ^- @
偏差是一个乘数,用于根据有关该池的预期 PG 数量的信息手动调整池的 PG。默认情况下,偏差值应为 1.0,除非另有说明。你给池的偏差越大,你期望池中的 PG 就越大。
+ E* q' {( l% _- |, x- E& d6 o$ F0 A  _
要检查池中的bias值,请使用osd pool autoscale-status并查看BIAS列。要在现有池上设置bias ,请使用ceph osd pool set <pool_name> pg_autoscale_bias <bias>。  t$ Z) E7 }- A* ^7 X2 x

, H+ c% o: ~* _1 L  J  m: L如果您提前知道池的使用率,请在创建池之前使用 pg_num 选项。
" x$ x0 y2 `- F' y/ ]# d- V6 J首次创建集群或池时,仅消耗一小部分集群容量。因此,您的系统可能会低估集群或池所需的 PG 数量。如果您提前知道集群或池的使用率,请在创建池之前使用该pg_num选项。这将帮助您的集群提前计入适当数量的 PG。* K; [* q: t& F. ]0 V

4 e# ^/ B( X7 L要检查池的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>。' b/ ?+ o( w# e; L, b0 B: y5 Q/ C
6 g2 F5 a1 X- c5 _8 q
使用 pg_num_max 值设置池中的最大 PG 数。, O8 b  r, i. n
可以指定池中的最大 PG 数。这在创建较小的池(例如 .mgr、元池或不带--bulk标志的池)时很有用。
  _8 y" H+ ^8 P3 G4 R. H% J
5 W+ _) J( Q( K7 b( s要在创建池时指定最大 PG 计数,请在命令中使用可选--pg-num-max <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_max <num>进行设置。
/ O+ M9 ~+ p5 F( h7 i; u5 k, ^( Z! |
1 F$ f; h9 V- X1 v' g使用 pg_num_min 值设置池中的最小 PG 数。
( X! m7 x- ^7 O/ ^3 v同样,我们可以指定一个池中的最小 PG 数。当我们想要客户端在执行 IO 时看到的并行量的下限时,这是有利的,即使池大部分是空的。这在创建更大的池(例如设置了--bulk标志的池)时很有用。
- R6 i2 t) Z9 }  n; P3 S: e& I$ t1 F( h6 O* s7 ?
要在创建池时指定最小 PG 计数,请在命令中使用可选--pg-num-min <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_min <num>进行设置。3 x. z" y; U5 ]  s- o
0 w% H. |0 C* l

" I- L# h. O+ E9 R设置目标ratio:- n) ^. B# ?6 ^; F. W+ o# w/ v
ceph osd pool set volumes target_size_ratio .8 ! y7 c9 ^3 ~) [! r3 H. b
查看是否开启:
" v  F" Y2 z6 E, c  V" g: O# _, c7 t+ Q0 s* k. Y6 W, y8 l

/ q+ p$ l4 X. Z" G4 u, k8 \$ @+ M$ d

; D- G1 O, P0 R1 o
- o: C! Y  h/ r7 p+ K1 w  B6 v4 I7 o/ t3 z7 [: {3 m/ P7 H2 k

0 \4 N- y) r) Z# c* B- l2 i  G2 L- d8 r; B) K

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:05:26 | 显示全部楼层
关闭自动伸缩:& @7 R& K9 t6 _' K2 N
ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off- D  H) {, M+ T/ @. ?
set pool 6 pg_autoscale_mode to off
8 z; x, G5 E/ j# |: O( l; e开启自动伸缩:
. }4 _2 b1 c* X[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on; S0 q* `7 }0 x
set pool 6 pg_autoscale_mode to on
3 K' ?- d' v. a5 w" T( |( \2 N. a  A' K. U

' ~3 J. Z9 p' q: [; N[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off
3 U- ~$ l/ L0 F: e$ G& c6 Y- zset pool 6 pg_autoscale_mode to off
5 X! q& g5 {% o0 e! _0 `8 h[root@ceph1 ~]# ceph osd pool ls detail
. f2 Y1 Y+ o7 Apool 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: a' D3 o; h0 v  T
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, L" Y$ o% [# D/ r' {
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/ r# X( p9 D! k1 |( u5 N, `1 n( x
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
! {" l* k# @0 u* b7 A2 W5 _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 rgw8 G. ?  h6 a6 m  L1 S
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 off last_change 376 flags hashpspool stripe_width 0 pg_autoscale_bias 4 pg_num_min 16 recovery_priority 5 application cephfs
6 l  X8 ^' E: t# P4 @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 cephfs7 L0 _5 v. y6 h" [+ [/ ~
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) `6 q' j" J1 {; c

5 [( n: M' B( b  h[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on+ a& K/ O% L% C, Y5 x( H4 N0 X/ w
set pool 6 pg_autoscale_mode to on
6 b  Y. [- N) z* f% O[root@ceph1 ~]# ceph osd pool ls detail / [& v( K/ U+ Z8 ~
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
  M# y# d% l1 [2 O3 W1 H1 kpool 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- m- a7 o4 N8 \; r8 f7 L! c
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
/ H1 Z* i, R  rpool 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
8 r# Q4 E+ i* a$ h( m# xpool 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+ }5 Q4 q# B# [
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  v: b, J+ P6 T" L
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! E1 J" s2 a% ^2 {0 ]$ f
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( p, @$ A' w3 A2 G1 ?' v; l
5 A! P/ L+ z( F1 @! F; \% }

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:07:39 | 显示全部楼层
调整pool的pg数之后我们观察到的变化如下:
  ^. \" r7 {+ ~% U1 W[root@ceph1 ~]# ceph osd pool set default.rgw.meta pg_num 64& h% q5 |8 y' V* s5 Q/ B3 s
set pool 5 pg_num to 64
5 ?0 d, c3 q5 F9 ~[root@ceph1 ~]# ceph osd pool set default.rgw.meta pgp_num 64
) ~* d6 k  |, J7 Mset pool 5 pgp_num to 64
6 g3 ~. I% L7 k7 [7 G, [, C5 ^1 R3 y0 _3 M) |6 m
此时的状态:
* U" j, T; U* {2 ~* B+ g[root@ceph1 ~]# ceph -s; ~3 d8 H8 l# C. V  H# J
  cluster:* d/ x* O# ]4 q0 b. l9 x7 x
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297/ q) P/ v: G3 z3 X6 n
    health: HEALTH_OK: P' |0 ~  f2 B" n, i
8 V! A' X* B" k9 u4 l* m
  services:
' u9 J( @# c. e$ N) H/ i    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 4m)7 V, ]+ k; U2 T! q
    mgr: ceph2.twhubv(active, since 3m), standbys: ceph1.zmducz, ceph3.dkkmft2 y5 h! Q2 B/ O8 d- {
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
' R* y2 S! E, p. U8 F    osd: 3 osds: 3 up (since 3m), 3 in (since 11h)
5 F: |- }" x, ]6 L    rgw: 3 daemons active (ceph1, ceph2, ceph3), c3 H: [+ {0 V1 `/ b* m
# X( m# Z' u6 p7 k) t
  task status:
8 a  l$ Z; n- X0 b& \) D# b( n9 j
6 |& L/ v# s9 Y0 V+ V  data:+ Y9 K  [* t2 m2 K
    pools:   8 pools, 233 pgs1 a8 r# R7 i, @
    objects: 240 objects, 157 KiB# h3 X- G+ C8 b2 a8 S0 N/ E
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail1 z1 S1 d% Y. f" j$ U9 h2 T
    pgs:     233 active+clean
- I0 k* _% H: p- Y' S! r5 g
+ H1 D# p. m+ X  Z3 U. |, l/ x
  L1 E7 n: p4 u$ G2 f& K5 @4 \2 b4 N- x3 a4 o6 m

0 e) k- u. M- ?7 qpgs到达某个值:9 x8 J' o4 Q; W/ ]: X4 R
9 j" L  D9 m- L+ X& v5 M/ I

6 |" S1 w. v) u查看pool池的详细记录:
& U, v& X8 l* H8 U7 U " i7 X7 t: o0 |5 S6 U( B
[root@ceph1 ~]# ceph osd pool ls detail & @! ?  C; }9 f: S1 f
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
& I" s* A% C. d2 o, o! gpool 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' S' ?- W$ V/ V0 p6 [. q% t& m
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
# c% F( ^" R+ e: P( G" Y' fpool 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
, Z+ N2 i. n( l; J1 U( Dpool 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
  J, W2 y% w8 v5 C* N1 y# Epool 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
3 e# }: N9 _3 J( x; \8 _! q9 Xpool 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+ b! U5 {9 H" C, P0 _9 P+ a
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 rgw1 F) Y3 G  H- T' l6 G1 q

7 {4 N3 _. x- I4 k发生变化,pg开始下降:
  }- s! L2 Y7 b, Z[root@ceph1 ~]# ceph osd pool ls detail % w1 u9 U2 s, E$ n2 {; i
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& ~0 ?# J, O' e; `
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! r$ |, r  S+ D: g: w5 ]
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
- D" `) c5 B! a/ Upool 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
! N5 I- r( b+ g; f; k5 e6 ^( d# |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 rgw3 t" t) @* I; m8 w! x% F
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
& P1 K' M. W: l/ K. O. Ppool 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 cephfs0 v( {! ?5 D# l; b- r
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 rgw3 T% o1 w5 ^! C. y
! K6 q, n& ]4 Z1 z  _+ \6 `8 Q
状态pgs也在下降:
" Q( Z9 y- b4 I1 `$ b, n[root@ceph1 ~]# ceph -s
7 f& H: G$ u5 @! u2 N+ u. X  cluster:
2 m) V) F. _0 B( E5 y/ n$ k    id:     433d3d2a-8e4a-11ed-b84b-000c29377297
) C# Z; j0 s+ O+ a' `0 r: k. q    health: HEALTH_OK: Z. V! V  k9 e2 Y: z2 S, ~

# ^# r0 v* _# X$ k7 X3 O# I+ v  services:8 {: L. ~5 m3 s3 F+ N$ \/ T* ?! |
    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
' a* g: F7 F+ _( a$ n    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft8 U; o5 v% }4 }' J# ^$ ?
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby1 T; S5 u7 i/ s- m, c& |  Y# n
    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
% \- g9 H$ Q" I/ C2 V9 [' _    rgw: 3 daemons active (ceph1, ceph2, ceph3)
0 F+ I8 h' j% U; ~4 q9 O3 g
% O# F1 `8 X$ G% R# r9 t! P1 c% u8 A  task status:3 C  c+ ]6 [1 N+ m" i3 f. q

# ]8 F" o8 ^8 }( B) O' n4 w  data:
$ J$ K! v5 J* u: X( ?5 T2 `. {    pools:   8 pools, 228 pgs
% ~. x5 V4 }1 @9 }    objects: 240 objects, 157 KiB
8 L2 B, U. A2 i    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
3 n& h1 k! m, s8 R    pgs:     228 active+clean! c; _2 N1 P$ m* F" ~6 \: I5 j

7 ^: v; x- z* ~# `& i9 P  progress:
/ t1 @: ^0 b2 g1 w9 n. q! r    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s): `1 q, W  s- X' D3 Q' ]
      [............................]
5 M9 @$ z8 v- F+ L$ x' I- h& B ( e' r) C; @, i& `: Q! J3 [+ k7 R
[root@ceph1 ~]# ceph -s
8 y& q8 O3 W! n. o: S0 i/ x3 A  cluster:; B& [3 Z. {$ r/ [7 e# H
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297" E. l+ x, K" z; K( H8 z, l7 Q( N# u
    health: HEALTH_OK, a& u& B  Y" c( y
9 U# d# I, c( D, y; l
  services:
7 _! h: F+ p. l) V    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
1 T0 {: M: x5 T4 j; z; |8 W) E    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft
2 d- |! ^( A3 J1 a- R3 q) e    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby' \8 k0 j9 v, f" p
    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)0 y6 y( S8 G7 d
    rgw: 3 daemons active (ceph1, ceph2, ceph3)
: M  c5 F5 l$ A8 T1 o$ H : W1 K9 w  a& f
  task status:$ B; l9 A$ m3 F

2 c0 G0 u4 b" U. e1 M. [  data:, Y' u- ?9 |4 v% }" s2 H  I
    pools:   8 pools, 228 pgs0 P5 k% T; W* r$ k  [
    objects: 240 objects, 157 KiB2 F3 y  J, @/ n% N7 f: A
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail' }% @7 Q- C& p0 g
    pgs:     228 active+clean
$ C+ J( Q. {, ~7 t  ?* s
: ^  ]- f" V, z* N  progress:
1 n. n" z2 v+ o( m2 |9 Q9 S    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)
. }) r4 V% k) O8 _& L      [............................] 3 Z; H) P. A; A1 A1 S

4 h. h  f4 P# j# l6 t% _
; C4 o' i- m/ f( K
, [0 v8 |; ~; u等待同步一会1 u* h: _, ~9 \: V
[root@ceph1 ~]# ceph -s
( y: V# R' n' c7 g: E% y  cluster:# k1 \: @! W: v2 k: K% W4 k
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297) x- ~! R% u- w+ X. U8 \
    health: HEALTH_OK
/ @1 D) t, c( [3 D! o. r/ I' y/ U$ |/ [: h1 _* [: x  e
  services:
6 d. k2 j! v: ^9 w- H5 o4 u+ o' L    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 10m)% ]# Y5 g. H+ i- m
    mgr: ceph2.twhubv(active, since 9m), standbys: ceph1.zmducz, ceph3.dkkmft7 @$ T" ^/ c& v+ q
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby# e0 L* l, C# {2 C+ K2 p6 a1 A* C
    osd: 3 osds: 3 up (since 9m), 3 in (since 11h)
. r* N+ {! D7 B1 W. X  _) P' J    rgw: 3 daemons active (ceph1, ceph2, ceph3)  b4 ~* W' J/ ?: y

8 V5 x' R5 J# L* H! m  task status:
$ }9 E" t) ~* ~/ a! q4 {8 H# I# m3 S: a# M
  data:
5 V' H) i' K, n% D    pools:   8 pools, 185 pgs
9 Y# O8 W2 }. C9 d    objects: 240 objects, 157 KiB
/ ~: F( F2 T( c; T( k& @- C    usage:   3.0 GiB used, 57 GiB / 60 GiB avail9 V! y3 P( R0 j
    pgs:     185 active+clean* B# h4 d* Z; C
! I# U! e- {1 c- |! Z' K
  progress:3 S2 r3 M9 w8 t3 v1 g' [* ~
    PG autoscaler decreasing pool 5 PGs from 64 to 8 (5m)
. o; F8 v" |8 M) I, z0 P) d5 S" z      [======================......] (remaining: 81s)& U" {% @: A0 _8 o; y$ r

1 h- h6 Q; Z! j+ X自动下降到185。因为是虚机下降速度较慢。4 h7 l( S7 W4 T. x8 ^! s" g

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:37:11 | 显示全部楼层
[root@ceph1 ~]# ceph osd pool autoscale-status
5 Q' f' ?) P' a( c/ [: I1 s; |8 MError ENOTSUP: Module 'pg_autoscaler' is not enabled (required by command 'osd pool autoscale-status'): use `ceph mgr module enable pg_autoscaler` to enable it0 \  f1 G- q6 ^% t2 {' m; y
[root@ceph1 ~]# ceph mgr module enable pg_autoscaler. Z2 S% x& I" a
[root@ceph1 ~]# ceph osd pool autoscale-status
  p& b. O: h+ E/ q# h; U1 OPOOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE
( O. `$ ^% g* ]# W. O+ idefault.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      8 f5 u: \# u0 F0 _% u: W
default.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      2 A2 [$ q+ ^  S2 ?+ J7 w! K9 J! _
.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      # M9 A- t% u  l1 n
ocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      0 h5 L5 |  P% B& s/ o+ a
metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      
7 C1 [# }( Z" H; N  u+ x0 ?default.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      
" h2 Z9 p8 L. v0 t# |9 scephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      & a  ?+ i, ?$ R5 ^  w0 K
[root@ceph1 ~]# ceph osd pool autoscale-status
& P( _2 Z% w1 V( t: n7 k, CPOOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE
, N6 U# u  w* h$ q( h, S6 C% ydefault.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      
9 x9 B+ V6 W7 W; ?. ~% a, Hdefault.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      1 R5 C1 H; {; V+ b$ M1 g( u
.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      . c5 J6 k* K2 a$ S
ocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      , u- N7 V( i" b9 ^$ \( ]
metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      
5 K0 N5 E6 Z5 m. adefault.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      
: s$ g4 ]( f! D1 dcephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      " V2 x' f1 n! X0 o4 ]' y5 b4 W

; k  X( s) C& Y% y8 b. f( x
& B% \1 Z& v' e# \& c# Q* J# E9 _: f6 e
- {# q& l7 e% e8 n  K0 X0 F4 S" d% G+ F( Z: ]( |1 m: s4 w) c& q
设置目标ratio:7 |" b. }( C+ f; {  O8 j
ceph osd pool set volumes target_size_ratio .8- }6 t! u! T" I; Q" F0 R2 D9 l

- n/ A$ w7 S/ G; [查看是否开启
; ~! U* x* q+ `2 c# J[root@ceph1 ~]# ceph osd pool autoscale-status
$ K' G  U9 ]0 d6 F" n% H$ RPOOL                         SIZE  TARGET SIZE  RATE  RAW CAPACITY   RATIO  TARGET RATIO  EFFECTIVE RATIO  BIAS  PG_NUM  NEW PG_NUM  AUTOSCALE  ' e) J) N8 H/ c# P+ }- m& p/ X7 P
device_health_metrics         19                 2.0        61428M  0.0000                                  1.0       1              on         ' L; O1 u; W, O8 k( T9 e
.rgw.root                   2110                 3.0        61428M  0.0000                                  1.0      32              on         ; a8 o/ s5 {% ~# d6 S9 x3 \
default.rgw.log             3583                 3.0        61428M  0.0000                                  1.0      32              on         $ f; f8 t' g; Y% w$ O# r) B
default.rgw.control            0                 3.0        61428M  0.0000                                  1.0      32              on         
: Q0 y- P; v1 y" @default.rgw.meta             829                 3.0        61428M  0.0000                                  4.0       8              on         : y* P; F. g# R4 \
cephfs.cephfs.meta         72392                 3.0        61428M  0.0000                                  4.0      16              on         
+ ^; t/ {5 v  C3 F3 H" J1 k8 |  d; ?cephfs.cephfs.data         131.2k                3.0        61428M  0.0000                                  1.0      32              on         + v4 q6 Y' M" R  U+ G, r( A
default.rgw.buckets.index  96810                 3.0        61428M  0.0000                                  4.0       8              on       ' B- @6 E9 L5 e
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:14 , Processed in 0.023945 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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