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

ceph 15.2版本pg autoscaler PG自动伸缩

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-1-9 08:29:39 | 显示全部楼层 |阅读模式
使能pg_autoscaler:
# {( A4 C# W! B/ o7 Sceph mgr module enable pg_autoscaler; r6 O& y6 k1 j2 k! i  K* l
查看PG自动伸缩状态:1 r9 k  K5 G% q- C8 Y4 i
$ y# r8 Z! ?3 D* V# M
% N4 r: F; Z5 W( W6 a; Z7 i1 W" j8 y
设置PG自动伸缩:(ceph osd pool set pool_name pg_autoscale_mode on)
, u0 B; L' D9 K; i' r ceph osd pool set testpool pg_autoscale_mode on: E" i$ L7 o8 n
ceph config set global osd_pool_default_pg_autoscale_mode <mode>
# q9 d9 U' o7 H: M5 _* R& p: k$ k# c& }  ?! S4 E
如果您希望一个池相对于其他池消耗更多的集群容量,请使用 target_size_ratio 设置。) J4 _; ~! K. q( \& r% \$ \0 w
可以使用target_size_ratio设置指定池的目标比率。如果您知道某个池相对于其他池应该具有一定的比率,则此设置特别有用。除非另有说明,否则每个池的目标比率默认应为 0。您给池的目标比率越高,您期望池中的 PG 就越大。
! J, G. @2 ?$ X, s# w- G# A  v  C
4 `0 V/ V+ a/ V/ Q
要检查池的目标比率,请使用osd pool autoscale-status并查看TARGET RATIO列。target_size_ratio可以使用ceph osd pool set <pool_name> target_size_ratio <ratio>进行调整。
& X# Z4 d& T, o% h3 [' Z  d5 v 要在创建池期间设置target_size_ratio,请使用ceph osd pool create --target-size-ratio <ratio>。' ~  Q$ @9 m; m

' Z3 A6 u+ [5 W2 Q. N( ]使用 noautoscale 标志全局切换所有池的自动缩放器。
' R9 r! @8 w+ y- N1 G% ]* d' B现在可以为所有带有noautoscale标志的池全局打开和关闭自动缩放器。
, p* s4 f, {5 K* K/ K) b默认情况下,此标志设置为 false,并且每个池的默认pg_autoscale模式(即 )on保持相同。; h/ m9 r' ]8 m
9 D4 L9 q1 |( W- L+ e8 s8 C$ K
如果要为每个池打开自动缩放器,请使用ceph osd pool unset noautoscale。如果要为每个池关闭自动缩放器,请使用ceph osd pool set noautoscale。要获取 noautoscale 标志的当前值,请使用ceph osd pool get noautoscale。% G* u9 l1 D3 O0 O
# }7 y7 ^3 U+ z8 K
使用bias来帮助自动缩放器准确调整 PG 的数量。
. ]! A$ R# [2 O5 x' ]2 \偏差是一个乘数,用于根据有关该池的预期 PG 数量的信息手动调整池的 PG。默认情况下,偏差值应为 1.0,除非另有说明。你给池的偏差越大,你期望池中的 PG 就越大。/ W) }" c; z  k# k$ N' }9 y& o
" I1 x8 U( k1 _8 @; l7 I+ ]
要检查池中的bias值,请使用osd pool autoscale-status并查看BIAS列。要在现有池上设置bias ,请使用ceph osd pool set <pool_name> pg_autoscale_bias <bias>。3 y, n& }3 o8 x9 P6 K
+ Y3 w1 U8 i+ @+ z
如果您提前知道池的使用率,请在创建池之前使用 pg_num 选项。( a! p7 a" y1 ^
首次创建集群或池时,仅消耗一小部分集群容量。因此,您的系统可能会低估集群或池所需的 PG 数量。如果您提前知道集群或池的使用率,请在创建池之前使用该pg_num选项。这将帮助您的集群提前计入适当数量的 PG。8 h: J0 e0 l4 |& i3 V
" n; [7 u) l/ j/ E% F/ C
要检查池的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>。
7 F. e; B1 J) S" m  H* I; Z: h# q# R) F& Q* W, r
使用 pg_num_max 值设置池中的最大 PG 数。
3 d+ Z) J! V% v0 ^3 N! C; z  d2 l可以指定池中的最大 PG 数。这在创建较小的池(例如 .mgr、元池或不带--bulk标志的池)时很有用。
& {* s; P) p' i! u' p3 J" N6 F# m( T3 A
要在创建池时指定最大 PG 计数,请在命令中使用可选--pg-num-max <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_max <num>进行设置。
6 n" e  a" f+ a
) Z. J$ E1 r. A8 g/ G7 [使用 pg_num_min 值设置池中的最小 PG 数。  E! B. R! T+ Z; S& {
同样,我们可以指定一个池中的最小 PG 数。当我们想要客户端在执行 IO 时看到的并行量的下限时,这是有利的,即使池大部分是空的。这在创建更大的池(例如设置了--bulk标志的池)时很有用。
& J9 R4 F; Z7 C/ Z  g, {& J
: N, T: X; F5 R要在创建池时指定最小 PG 计数,请在命令中使用可选--pg-num-min <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_min <num>进行设置。4 x. _& j4 x) @- o! |
4 ]" [' ?, ]* E7 A) j

* U% _8 `- B0 ?设置目标ratio:
/ ^' \! N9 t2 Y6 b. Tceph osd pool set volumes target_size_ratio .8
3 i, F  ~! R. [) z* H: {查看是否开启:+ q. h! H2 a: S
( Y; R2 `  {$ b8 h
0 \$ A% e" k3 |3 C0 K+ c) J) u

2 T5 W: A1 o& }4 ^4 B  [% Z; P" w$ y0 c* K
' D- v& x: d* L) q8 i' S2 o3 S8 _! V
2 P6 A* L  L: z5 \0 }

" ^: Y* t3 S$ l4 I0 ~3 O( _, ^
9 {/ t+ M$ B& V$ B) @, C& U

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:05:26 | 显示全部楼层
关闭自动伸缩:
9 ^- A. P. y, c. fceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off- Z" t' f  {5 y7 I' J
set pool 6 pg_autoscale_mode to off
+ N( F* B: j9 g% j开启自动伸缩:
6 R# {) x* \" T0 Q0 m[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on
8 `1 C9 e1 j+ b) c; I2 cset pool 6 pg_autoscale_mode to on
5 d# c/ K  a- ~" P6 p8 y# p# P! g# L: X/ @

; t& {8 v& v' `8 `% K[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off
5 ~! l% e8 p4 R/ Oset pool 6 pg_autoscale_mode to off
! c+ C9 D5 l6 M2 d8 e" ^0 x[root@ceph1 ~]# ceph osd pool ls detail   }4 k! O  B0 i6 f1 @3 e+ K
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
2 b  \& ?  R( y# dpool 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
4 f9 p2 \- b/ k& u7 E* G+ G8 n! gpool 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' W! z0 S, p& G" ?' H4 z* 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 rgw$ x7 h5 R; j" U5 O$ \5 z! D
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
5 [0 ]. s8 {2 f/ S3 vpool 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
4 v0 c  }. x2 G/ A# H8 w$ |! Lpool 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$ w8 x) _2 U$ e. 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 rgw: n1 ]$ ~& Q! E
& j0 x) S0 s/ l. ]1 H
[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on
0 A" Q7 j* @; k# B* W: w2 eset pool 6 pg_autoscale_mode to on
2 q! ^7 `. P. g1 l3 _[root@ceph1 ~]# ceph osd pool ls detail 0 @+ Y4 j* w& o  v% U- o' h
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
8 C, p- a7 H* `( m1 M7 C( {) Bpool 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 rgw5 f( h7 v( K8 A4 Z- f' k
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 rgw8 }( t8 ]$ b2 Z: _
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
( M8 L# r9 l& K6 l5 o9 spool 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
! d# O* k) m8 F, spool 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
, o4 q3 M- Y0 N( H6 z- `  P% @; Spool 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! P! z9 T) x2 x8 M  V
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
7 v6 ^. b8 @- D- l% d- S, q6 S1 n9 Z/ L2 ]+ @& y' c

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:07:39 | 显示全部楼层
调整pool的pg数之后我们观察到的变化如下:
: z) D2 G4 Q& D1 R[root@ceph1 ~]# ceph osd pool set default.rgw.meta pg_num 64, L8 [$ M$ y/ p  Z8 {, q/ U# }
set pool 5 pg_num to 64
( S2 [9 Y) Q7 O! C) @2 e[root@ceph1 ~]# ceph osd pool set default.rgw.meta pgp_num 64
6 R  K% \& g* ^1 M6 qset pool 5 pgp_num to 64
  {$ Y+ G! c  d
: e7 Q' i/ k1 v" L- R7 ?; J9 T, o此时的状态:: j% ?/ G: |& f% `- A- w
[root@ceph1 ~]# ceph -s
1 H5 m% [  q" K- J& P  cluster:  w! ^. W8 G7 d* U+ i- p
    id:     433d3d2a-8e4a-11ed-b84b-000c293772975 `' c7 j& Q& W- D5 I: Y- z
    health: HEALTH_OK
' f) u9 U  Y6 \0 [3 m- {- A5 J* r) `& l8 }2 G4 r$ U2 i# g& N5 ^8 a
  services:6 t( J  v+ |6 t4 ~
    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 4m)9 Q7 U5 U( o: }* ~( B4 H
    mgr: ceph2.twhubv(active, since 3m), standbys: ceph1.zmducz, ceph3.dkkmft& k# {! c: a3 L$ j8 n2 O1 A/ Y. ?
    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
  a6 D0 t7 y+ H( \3 c    osd: 3 osds: 3 up (since 3m), 3 in (since 11h)( T2 k" ~$ @4 x$ F# N) o
    rgw: 3 daemons active (ceph1, ceph2, ceph3)
0 C6 `% K( V+ c/ ?- J. Y9 l, D4 |4 b5 i# O1 `
  task status:8 ^1 \' F. Z* j- M0 y+ k

/ L. w- A4 ]! X9 e5 ^  data:; F, z4 _9 I+ R6 I; M6 {, \* G
    pools:   8 pools, 233 pgs) Q( |7 x2 U+ X  Q% l
    objects: 240 objects, 157 KiB& ~: T  Q1 b& v
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
7 G7 L+ ^5 m1 |4 n) h- c    pgs:     233 active+clean% k7 L; l$ ?2 R0 j5 l/ J

3 ~1 d  s2 T9 D5 H
" G: v9 m- ^( X; z& B' G1 K. e, E0 p' j/ Y

" b1 P' H  L; Y  u9 h+ `* Epgs到达某个值:0 u+ s! M/ B* H/ ~* j0 y7 J7 {
# h# D8 y  O0 M  O7 g
7 v% m" R' v- x- e' H4 J
查看pool池的详细记录:% [# n, ^1 w# M+ \! i# E4 p" n

5 b: M; G5 U- k& K& ?/ X0 B' X* T[root@ceph1 ~]# ceph osd pool ls detail 9 [, D9 p. j' E# q  ~. W
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+ h5 b3 M+ Q$ L0 \5 h8 `
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- H" h- e; `3 S, X$ U
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. H0 z( K7 a+ n/ D  C) apool 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
0 O) M5 H" ]; T( N- tpool 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 rgw5 |# U, k  q" f9 q4 L" J
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
4 C* s; f" O& W+ O5 L; spool 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
5 Y  i1 G) O+ \$ L& Ypool 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 B6 A* _1 q& d; U/ |/ E0 D2 v. I
发生变化,pg开始下降:
4 {$ P# i4 U4 G[root@ceph1 ~]# ceph osd pool ls detail
/ G+ b; b; s2 N; p* c3 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
! b! \: L. \7 F2 @' a- Ppool 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 rgw0 w2 L2 F# D5 i4 O" z
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
3 ?6 j5 F/ l: P! hpool 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
0 p1 A* T1 g3 ?' V) t1 fpool 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! S" ]5 {) n/ w4 y! h! g
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 cephfs4 U9 o  t& a1 N
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
, W2 _% {1 q& Qpool 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, m. ]( N! H* P$ V+ k

' X# I. H% Y1 c3 q状态pgs也在下降:3 {5 m: O& s0 V6 o2 B- k7 I
[root@ceph1 ~]# ceph -s
2 C( o8 P: K: u0 s+ b  cluster:7 J4 h8 L9 q8 T1 Q7 x8 u9 `/ O
    id:     433d3d2a-8e4a-11ed-b84b-000c293772974 X! T5 [: o/ o$ Y+ l. b' `
    health: HEALTH_OK
1 u% Y+ Z# U% C) J- s  D ' V# T- `) n! u/ u, o
  services:
: m2 U) j1 q6 g) A    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
( x* y+ `. |9 O    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft
. G( r! r9 N' [6 i4 ^8 Z    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby2 }; g% a* Q4 ^' I1 I7 [( f
    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
# Z9 u& m1 b4 t' \' n7 e    rgw: 3 daemons active (ceph1, ceph2, ceph3); @4 t: L! }6 {! h2 b5 R
$ e( i1 M% e  k7 r
  task status:  a, \8 B' r% C- F
% s: G) U5 t/ n9 M" b* X1 K- }
  data:8 g! M2 E! a5 D3 x; E* k6 \& G
    pools:   8 pools, 228 pgs
* G7 m5 _6 @5 R  e  w    objects: 240 objects, 157 KiB, S3 ~' x& y0 i2 M: \
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail9 z$ q% T/ F- h+ h7 y+ i! B
    pgs:     228 active+clean- R, R" A  ^  n( L: g; B

1 Q" H  |. g: ]% ]2 y& B3 B0 _" T$ l  progress:1 Z2 Y- v8 t/ [) Z/ o
    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)8 w6 v, R& U+ e
      [............................] % E0 [5 V" h3 E4 J

. q. T7 E( k* w$ \- a- w: y9 X. Z[root@ceph1 ~]# ceph -s
6 ]9 F( F6 [/ B( C( A( U. {2 r  cluster:1 X& n; @  C# A# h, b7 B
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297; Z5 p) a; u3 D$ {8 V0 V
    health: HEALTH_OK* @  R/ H% I* Y" i0 f

8 |! \+ {1 @( [5 w  services:
! b6 D! a6 i7 N2 Q: Z0 y& I& ~    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
; P) V* b* Y. E4 S( C$ r    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft
* H* f; S( |& \! E    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
. k0 [2 W+ Q/ U" y! `    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
! _( }: K+ b( _/ [% x    rgw: 3 daemons active (ceph1, ceph2, ceph3)# q8 c, ^8 w/ U; e3 I0 }
5 J3 o* d' E8 T: X  H, t) U
  task status:) S4 R2 E. c0 r* P& R
4 g8 q" j' k" A- z6 |) h( E
  data:1 ]4 W4 Y4 z; C' }  O6 y
    pools:   8 pools, 228 pgs+ b: z8 k- g( F8 {! j
    objects: 240 objects, 157 KiB4 P9 B/ D' Z% o, V+ N. D
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail$ j. Y; Y* `; s& O, ^
    pgs:     228 active+clean% R1 h3 T) E# S- q4 }+ H

4 e# H) C( @4 H. e# y  progress:- c& M9 i' p, q7 f5 I
    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)3 v. ]- S4 N1 g
      [............................]
. @! o+ f( r. Y2 n( Z+ M2 r! V" q  q) ~ ( h1 d, w5 H" y/ `

- w4 l: H1 O# P- O7 F0 n
/ o8 |- C; _0 N, f等待同步一会
! T, I4 V$ T# t% `  L4 w' I[root@ceph1 ~]# ceph -s; x7 b: u# \' s0 u
  cluster:3 a/ V5 Z: Z* N$ j; c
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297
. X% g$ T9 n: A    health: HEALTH_OK* c: A, _) p8 D) a$ G# u7 V

/ a2 j4 o  b8 G$ Z6 {# C) q  services:
" b* f: H0 W+ F    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 10m)
  a2 u/ G& ^4 X3 Y5 ?. z    mgr: ceph2.twhubv(active, since 9m), standbys: ceph1.zmducz, ceph3.dkkmft
9 N0 {" k, {; G1 S5 ~    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
' x  c) R( f, Q7 M8 s    osd: 3 osds: 3 up (since 9m), 3 in (since 11h)
0 h" L; ?4 L% w4 t5 C- N$ n    rgw: 3 daemons active (ceph1, ceph2, ceph3)
  v& L1 U* W9 m) Z" E. Y, ?: {! y
6 V+ z) I5 Y( X5 ]  task status:
0 A- ]% I8 U% L0 A! s2 I- `
3 X4 P  [' q! K- a" ?( P% e$ I3 C  data:1 V) [- p/ ~- o3 B- ?
    pools:   8 pools, 185 pgs
, e1 F5 o2 a% R: B6 n7 \: z8 `    objects: 240 objects, 157 KiB- M  G! p( E( \% r* X9 J
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
+ S3 x9 {5 e; o+ I. P4 R    pgs:     185 active+clean
; r& H' R/ U4 o6 s7 Y9 g" g! z; T. v' ?$ X& y
  progress:
+ w9 ~6 c- p/ o% R8 _/ S    PG autoscaler decreasing pool 5 PGs from 64 to 8 (5m), p3 D0 [0 k4 ~/ y" j+ _8 m
      [======================......] (remaining: 81s)4 y# v# e) r5 N. s

2 h+ V0 P0 D& e6 k$ B# W; {自动下降到185。因为是虚机下降速度较慢。
- W$ T+ K% w; N- {+ M% H+ H3 |

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:37:11 | 显示全部楼层
[root@ceph1 ~]# ceph osd pool autoscale-status
( h& d4 j: D# V9 |Error ENOTSUP: Module 'pg_autoscaler' is not enabled (required by command 'osd pool autoscale-status'): use `ceph mgr module enable pg_autoscaler` to enable it
+ ^+ R2 j: \. x[root@ceph1 ~]# ceph mgr module enable pg_autoscaler
/ W, K! q4 W: S[root@ceph1 ~]# ceph osd pool autoscale-status ' P# w( \3 Z4 t4 _8 S
POOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE 6 \2 F  E  `% \
default.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      
& ~! o  R- k) m7 k, X( Qdefault.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      ( q$ s0 w7 Z) u; `) }! F% K5 _3 @
.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      6 Q! S5 B& V) U, b0 n
ocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      : q' Y8 X" o$ y! E0 R2 T: s
metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      
9 j7 t+ r/ a' H5 P! H! udefault.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      ! z0 f: r% |7 I; l
cephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      $ _. Q7 u6 ^6 I' X; j8 v# F
[root@ceph1 ~]# ceph osd pool autoscale-status 4 z+ z/ A, |' {3 G7 n
POOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE
# K  Y8 s9 Q8 C0 b- o; Cdefault.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      
& @2 Q& d5 [: }/ {+ hdefault.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      
8 ~' I  I1 ]7 }( {7 U) T% P.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      % O6 F( [! R) Z6 z8 Z; i
ocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      
) H4 `7 P8 Z* S1 \/ ^$ ?$ J9 d# t" {metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      
% Y4 b8 c0 O; O: K7 Sdefault.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      
. a) h9 E) v& \% k3 ~cephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      
( W- V7 n" c  T+ X
, a6 V6 t) s" X# Y+ g% B9 `
1 b' W" g4 d0 E
" k& L0 \  G% C: t# ^7 B/ v/ Z# T" K5 c) B
设置目标ratio:, X- p8 e0 M# F& }
ceph osd pool set volumes target_size_ratio .8# F# X+ D# G2 V! a) c

. L1 @  f: q" S# v' }: U查看是否开启
. H" U7 L% @& P$ L5 r[root@ceph1 ~]# ceph osd pool autoscale-status
7 k2 u2 Q$ e$ W9 ^$ [POOL                         SIZE  TARGET SIZE  RATE  RAW CAPACITY   RATIO  TARGET RATIO  EFFECTIVE RATIO  BIAS  PG_NUM  NEW PG_NUM  AUTOSCALE  ! h. ?  _) b, U+ J& L+ o
device_health_metrics         19                 2.0        61428M  0.0000                                  1.0       1              on         $ ?9 p: n  F* `, W4 C
.rgw.root                   2110                 3.0        61428M  0.0000                                  1.0      32              on         ) l9 e' n6 D9 \( S0 r
default.rgw.log             3583                 3.0        61428M  0.0000                                  1.0      32              on         
* Z+ m" E7 {' i3 idefault.rgw.control            0                 3.0        61428M  0.0000                                  1.0      32              on         
& I9 F$ P: `- e% V1 w( H& l' U& jdefault.rgw.meta             829                 3.0        61428M  0.0000                                  4.0       8              on         ; r3 n2 y9 m/ w
cephfs.cephfs.meta         72392                 3.0        61428M  0.0000                                  4.0      16              on         " i, x2 u& b% `5 ^3 t/ y
cephfs.cephfs.data         131.2k                3.0        61428M  0.0000                                  1.0      32              on         9 `- y5 s7 E7 x0 b& x7 N5 e0 ]
default.rgw.buckets.index  96810                 3.0        61428M  0.0000                                  4.0       8              on      
2 g3 Z. ~2 f% x  K8 [" a
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-11 23:00 , Processed in 0.025842 second(s), 24 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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