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

ceph 15.2版本pg autoscaler PG自动伸缩

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2023-1-9 08:29:39 | 显示全部楼层 |阅读模式
使能pg_autoscaler:
( M" p) g/ U  Fceph mgr module enable pg_autoscaler3 e" M; L' ^% d+ ~5 O. G6 }
查看PG自动伸缩状态:1 ^, \$ u# ?. U" a+ o" A6 k8 a

) W" ~" O3 c' r+ M  m
; E$ J1 |6 O& q, s6 m1 _设置PG自动伸缩:(ceph osd pool set pool_name pg_autoscale_mode on)  J, x5 d# f( b
ceph osd pool set testpool pg_autoscale_mode on* Z" l  g4 n: w& s& S' ]* p
ceph config set global osd_pool_default_pg_autoscale_mode <mode>
% |9 X! d8 |1 V
, x8 `$ p$ d+ D/ n; G) \# W$ q如果您希望一个池相对于其他池消耗更多的集群容量,请使用 target_size_ratio 设置。
' ^& h4 [  y5 d5 H2 s可以使用target_size_ratio设置指定池的目标比率。如果您知道某个池相对于其他池应该具有一定的比率,则此设置特别有用。除非另有说明,否则每个池的目标比率默认应为 0。您给池的目标比率越高,您期望池中的 PG 就越大。
$ N+ _$ g, P# q, i4 {
  [; ]6 Q; n; Z; N: L8 u9 q2 F3 H: ]( `
要检查池的目标比率,请使用osd pool autoscale-status并查看TARGET RATIO列。target_size_ratio可以使用ceph osd pool set <pool_name> target_size_ratio <ratio>进行调整。
( I$ R' O; E- Z, B 要在创建池期间设置target_size_ratio,请使用ceph osd pool create --target-size-ratio <ratio>。: U& R. h) J" F2 ~* I0 e; i$ k

. I2 l7 y* _" n. s! n8 [0 q* q使用 noautoscale 标志全局切换所有池的自动缩放器。- V+ |5 x: W: I0 k( N& {, ~
现在可以为所有带有noautoscale标志的池全局打开和关闭自动缩放器。
' S) @- U; C) o" A+ ^" \( B* S5 |默认情况下,此标志设置为 false,并且每个池的默认pg_autoscale模式(即 )on保持相同。4 ?8 L6 c1 U$ z* P

- p6 \; K; v: a6 n7 K! o1 `! k如果要为每个池打开自动缩放器,请使用ceph osd pool unset noautoscale。如果要为每个池关闭自动缩放器,请使用ceph osd pool set noautoscale。要获取 noautoscale 标志的当前值,请使用ceph osd pool get noautoscale。
5 R0 q  B6 Y- [: b1 w4 ~9 ?9 J9 ?
: U  t' w" [3 \: A. t; x2 q使用bias来帮助自动缩放器准确调整 PG 的数量。
0 \! e/ M4 j9 a! n% ~偏差是一个乘数,用于根据有关该池的预期 PG 数量的信息手动调整池的 PG。默认情况下,偏差值应为 1.0,除非另有说明。你给池的偏差越大,你期望池中的 PG 就越大。: K. U4 x+ [) G; C( w5 D
  ^) O' n7 Z! `8 D. v
要检查池中的bias值,请使用osd pool autoscale-status并查看BIAS列。要在现有池上设置bias ,请使用ceph osd pool set <pool_name> pg_autoscale_bias <bias>。  `  D7 f3 y; f4 {

8 t. W5 c# c, J# a3 U/ x+ J如果您提前知道池的使用率,请在创建池之前使用 pg_num 选项。5 a( F! B+ W! c; X7 U3 p, i6 l
首次创建集群或池时,仅消耗一小部分集群容量。因此,您的系统可能会低估集群或池所需的 PG 数量。如果您提前知道集群或池的使用率,请在创建池之前使用该pg_num选项。这将帮助您的集群提前计入适当数量的 PG。1 D) ?% N! ]! x* {
  E2 ~  m* g1 @3 ?8 S7 @3 P
要检查池的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>。
% g3 b; j7 s" q- J) v0 D6 O3 n8 Z% Y
. L0 h1 K; k2 D8 z! L使用 pg_num_max 值设置池中的最大 PG 数。
- Z; e- t7 O& s& f% [可以指定池中的最大 PG 数。这在创建较小的池(例如 .mgr、元池或不带--bulk标志的池)时很有用。' F# q; b. @* R* d4 ~0 K

9 w( b; J  E& Z0 c7 z  v% E( z8 f! k要在创建池时指定最大 PG 计数,请在命令中使用可选--pg-num-max <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_max <num>进行设置。
+ t. x1 K$ k5 f, Z2 _
& v' _( a9 Y( b使用 pg_num_min 值设置池中的最小 PG 数。0 U# ^+ a0 Z- A! f9 `3 @. q
同样,我们可以指定一个池中的最小 PG 数。当我们想要客户端在执行 IO 时看到的并行量的下限时,这是有利的,即使池大部分是空的。这在创建更大的池(例如设置了--bulk标志的池)时很有用。
$ _3 m# P1 D  J2 h0 ?; L% D* |9 g) W! d9 ^5 ^. }
要在创建池时指定最小 PG 计数,请在命令中使用可选--pg-num-min <num>参数。ceph osd pool create创建池后,使用ceph osd pool set <pool-name> pg_num_min <num>进行设置。$ m; Q5 A6 t4 E1 K/ N6 J

6 {4 c4 q$ ~+ C
  h' h- e) [7 a3 P% `% ^$ a  J0 J- I设置目标ratio:
8 \) F; I! e) v  s+ L6 Oceph osd pool set volumes target_size_ratio .8 1 \+ J; G" F. G0 S7 w! d
查看是否开启:
8 W1 W9 r% |' F! s
0 V) @9 u+ @1 f% M) q. @. V1 x7 J. G- U9 Q

1 ?+ u" M9 _& B6 x; h
! H5 ?& A- j& a0 p$ R+ W6 |6 i* I( [* Y6 U: q
1 S! j9 F6 Z7 J/ n3 q8 q  [) W

, \) [/ ^# q% j5 m6 W
6 j) W* V  {( C& Z% y. R

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:05:26 | 显示全部楼层
关闭自动伸缩:
2 S- n, q2 x6 V! eceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off
$ S+ K8 _, f" M% S: xset pool 6 pg_autoscale_mode to off
8 {/ Z" S5 ^& Q' H0 d5 t1 \) \开启自动伸缩:* C- t6 K! o- }0 M% {6 u
[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on( t& \$ M$ }& K
set pool 6 pg_autoscale_mode to on
) t2 y: @, C; F7 d/ C' c5 f
. e2 F; y8 O0 j+ o
. D& n$ z% T/ q* s0 B7 b[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode off$ M. b2 Z$ S. h/ y6 H. p
set pool 6 pg_autoscale_mode to off
3 a, n0 h0 s4 w# U[root@ceph1 ~]# ceph osd pool ls detail . H7 }* y' A- Z" b3 G6 D" `
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% V6 V& D# t# H
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
) ^6 L! x. S! {8 y# a- Qpool 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
% Z7 r* c4 H; [2 U" qpool 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
+ E- T; j: [. a* p- |' ipool 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
1 j$ n' z& ]2 D+ _# n. Kpool 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
, _$ K. J7 `! |+ i5 ypool 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
1 ?0 d' o  J3 j$ Opool 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+ D* j- p1 i3 i/ q

+ w$ @; K# ?9 {[root@ceph1 ~]# ceph osd pool set cephfs.cephfs.meta pg_autoscale_mode on3 \" G0 k* @, p$ A
set pool 6 pg_autoscale_mode to on
7 b4 P& G' z# @& B/ F" W0 c; r[root@ceph1 ~]# ceph osd pool ls detail
$ f+ L3 @; @" N% U! Q0 {1 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" s: @) }/ R4 F( s1 P
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: |2 e% x+ x# g+ A; M& p. P, A
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
( A7 l( d$ l0 @- z$ \1 J% Y/ gpool 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 rgw8 Y" y' n) R  p, g  J8 s$ m
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$ |0 l6 x" ~/ o" m  q3 q
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 cephfs9 y' B+ B' l; \, p0 @
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- i# u2 }( Z1 K2 M, \3 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% u/ @6 Y% b7 j2 B# X
3 P& F' o- y$ y& y0 I/ Y' P6 K% j- Q

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:07:39 | 显示全部楼层
调整pool的pg数之后我们观察到的变化如下:" k9 q  w; R3 e9 n# B% i, k
[root@ceph1 ~]# ceph osd pool set default.rgw.meta pg_num 64& k) O/ O- S) s" b& W
set pool 5 pg_num to 64
8 ]% h* ^7 ~0 f4 Y# V6 ~[root@ceph1 ~]# ceph osd pool set default.rgw.meta pgp_num 64
) f8 |/ ^9 F* g& j+ Uset pool 5 pgp_num to 64: H7 K3 s/ ^4 U, Q4 S+ o# T4 B  z
; B7 |/ ?- k% \$ `
此时的状态:9 p: h& f7 V& r+ F' @$ {6 D' t5 I
[root@ceph1 ~]# ceph -s$ L, r/ C4 {8 H: W: D" ~4 ~
  cluster:' F) `# y$ t0 d' h; P( P- }
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297% C2 D: R# z2 Z
    health: HEALTH_OK
% Z5 l5 q+ ?) z
9 {. H3 l2 h  N7 z  services:! [6 O4 P4 u+ w: ?" K! w% y" w! c
    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 4m)
# s4 h) n" G, f1 @* P    mgr: ceph2.twhubv(active, since 3m), standbys: ceph1.zmducz, ceph3.dkkmft
& |2 T: e8 p* p- J, ?% H    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
/ r4 q2 V6 K+ o    osd: 3 osds: 3 up (since 3m), 3 in (since 11h); s1 O/ K+ `! G9 P2 _1 m
    rgw: 3 daemons active (ceph1, ceph2, ceph3)1 w. ^8 l1 i2 g3 G/ `, m
8 p5 c' _$ r: D* d, l- m8 E9 s7 U
  task status:( m- j. O: M( |# S

7 o; |- G+ {; j1 D7 P' _; j  data:. f5 L3 p* g  z4 B' N0 T: D
    pools:   8 pools, 233 pgs! ~0 G+ j2 V* g& R+ q" [
    objects: 240 objects, 157 KiB: Q/ |. u2 p" k2 p
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail
7 o8 F/ P, X$ v7 W7 k    pgs:     233 active+clean
; s$ n8 o6 ?& {3 w2 y/ k$ Q0 i% w/ z9 x5 }/ R

% r6 C5 H. V. @$ C  _7 p
) E3 F0 q/ O3 B
* K! ~4 ]. U0 X0 L3 K: Epgs到达某个值:
2 Z3 h. G) J8 R9 e) p: k9 s4 |4 x# F0 B
0 u7 u/ z' r+ H) |2 r+ c
查看pool池的详细记录:
0 w7 a6 ~( @5 [0 _* l8 G $ d0 b0 ?! G# A, X8 r5 F
[root@ceph1 ~]# ceph osd pool ls detail " G# ]& @; {( o
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, T( a4 ?; [  T6 z& R
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 rgw2 T7 `: a" U4 n, n. H3 Q
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 rgw3 {, v9 H/ i; J5 \) 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. J& e, r- ~4 s. T$ y
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 rgw2 T1 h0 Q* ?) t9 E+ Q: h
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' c" t3 Q8 [1 z/ O5 G- c
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 cephfs9 x) f6 Q! {  R0 e
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" k2 q4 j7 d3 L+ @

( F! a5 T! R+ l8 ]* K( }发生变化,pg开始下降:
3 t1 M' @( B7 p. v) u! R[root@ceph1 ~]# ceph osd pool ls detail
( B! |* V7 g# g' z$ zpool 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
$ E9 R9 Z1 t+ {2 ~9 ipool 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
2 \5 F$ t6 L3 Z  R) Q$ Kpool 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
: o. {" S* z9 T2 u  Cpool 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
5 q9 E" v- |5 S! }# N' dpool 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 k- Z, `$ ^4 r( t
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
0 g* Y/ C" v/ v; |$ 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
' |' }0 k0 C5 s7 k4 ~  Apool 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
3 i( P( x2 N6 S0 [+ v- d# n. ]1 v0 N. Q% y9 v
状态pgs也在下降:
/ a4 O9 [0 d8 H: L) l8 H$ o! `( R[root@ceph1 ~]# ceph -s
- |) t) |( e, {! q2 h9 N& g  cluster:
/ |% q7 O* `9 G8 h    id:     433d3d2a-8e4a-11ed-b84b-000c29377297% Z2 x7 X+ K: L# d6 U% |
    health: HEALTH_OK) @% h# J& ~% m* l+ H7 o% [4 E

: I: G5 |, a; H7 r$ O  services:
! J% e7 Y0 i  z. U. z    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
3 Y& P1 Q. u) J: A    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft
+ N$ m/ X6 l8 U4 F2 ]) j    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby/ `0 l' g& Z$ @( w: u" P
    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
, t5 c& y$ S3 a    rgw: 3 daemons active (ceph1, ceph2, ceph3)2 o! Q% y" K: m5 F3 C

) m5 }1 @: M# F6 [  task status:& [( B. m7 V8 G# M
& b: S7 F7 W2 Z( L; h) ^3 s
  data:
# N" \; q' A; W* ^/ z1 ]$ b    pools:   8 pools, 228 pgs
- t9 X3 T5 A7 Z! c+ a    objects: 240 objects, 157 KiB- d% Q! Z  w+ d3 m: B: E/ P
    usage:   3.0 GiB used, 57 GiB / 60 GiB avail# F5 d* U6 H9 e' i9 u/ A/ U
    pgs:     228 active+clean/ m/ d. A& \4 J* X6 A, a, j8 s! X

" H6 X  l& k  L  progress:
# f% l1 f9 D  {' [+ z    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)
" l3 K2 l* E7 L5 {& ^      [............................]
; Z$ v8 i7 X+ t9 q! d3 L ) f4 V+ M8 a& m3 N* F5 a* Q9 j
[root@ceph1 ~]# ceph -s
5 |( G1 d: m: |; F  cluster:# }8 {$ a6 i  ~! Z' {" j
    id:     433d3d2a-8e4a-11ed-b84b-000c293772973 C( G# \+ o- q! k
    health: HEALTH_OK
. a; w4 W6 T) `* Z- a* ^
) ~/ h$ b1 D" A  services:
/ z8 A3 b7 ~2 e" [% S" d) S( ^    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 5m)
" z2 ]$ O, @# w) f3 q3 m6 a. H- m    mgr: ceph2.twhubv(active, since 4m), standbys: ceph1.zmducz, ceph3.dkkmft
- O  v. k6 m& J& E- u    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby6 L3 B0 ^- d  K0 J6 X5 o6 i
    osd: 3 osds: 3 up (since 4m), 3 in (since 11h)
6 T+ S6 v: a3 E! i( T4 p8 e    rgw: 3 daemons active (ceph1, ceph2, ceph3)
( F$ u4 p  f5 N; }6 I7 \ , R& @; S( B# W$ L# N$ b3 h! S
  task status:* ~% s; x! |, P: F! _6 p9 P
2 j5 {5 [. e# {4 ?% _. Z8 H
  data:
  y9 f3 O: [% B; r! b/ v    pools:   8 pools, 228 pgs" _$ i# [$ h8 ^1 I2 H, j2 q# \8 o
    objects: 240 objects, 157 KiB
, `9 E9 l; e& B6 z3 g7 @    usage:   3.0 GiB used, 57 GiB / 60 GiB avail- I% p9 O' e6 x! ?+ k9 L8 z( Z
    pgs:     228 active+clean
" c7 Q' T( v! H * W: K/ l% _4 F+ D2 z2 B
  progress:* |+ `% e* e7 k! k# u" ^1 f. V
    PG autoscaler decreasing pool 5 PGs from 64 to 8 (0s)
& d% ?/ Y7 q6 T1 ^      [............................]
$ A" h1 y  T" d$ v6 W/ f; |( T / F  d* D4 |. H4 c' W6 A$ d( X

3 b' @9 P* c! z( J+ _- S" p. e# C) b3 f: n
等待同步一会
" I6 P6 H, k0 \) v1 H9 q[root@ceph1 ~]# ceph -s. ~! Y  R. E% e
  cluster:  p" v8 g- }; j: y
    id:     433d3d2a-8e4a-11ed-b84b-000c29377297
$ \1 Z+ D4 G; w. o$ z    health: HEALTH_OK
+ o' L$ a, U- o. o6 }: L6 y7 p/ O+ k# H8 E% v, k& p
  services:
4 f" K' Y2 s3 L1 d& c4 j- B    mon: 3 daemons, quorum ceph1,ceph2,ceph3 (age 10m)' i5 _0 }; b& p  Q8 Z
    mgr: ceph2.twhubv(active, since 9m), standbys: ceph1.zmducz, ceph3.dkkmft
3 i6 b( {- F1 c( M9 q& t+ P) N    mds: cephfs:1 {0=cephfs.ceph3.idylsu=up:active} 1 up:standby
; N& g# z: P2 @( f    osd: 3 osds: 3 up (since 9m), 3 in (since 11h)
4 ?5 J( {! [, y5 d    rgw: 3 daemons active (ceph1, ceph2, ceph3)9 M( d& J( Z: z  X. R

8 p  y& E# k# j& V  task status:
. D& X' e8 a7 [' {( ?, N" h% Q! a$ `: _" {) ]% L- V$ X4 h
  data:
, y2 A; ]: W, s( V  C6 Q    pools:   8 pools, 185 pgs
  ]: x* Z8 d* N+ X- h' U    objects: 240 objects, 157 KiB
3 X. f- x% w5 z1 N9 v: Z' Z. L/ w    usage:   3.0 GiB used, 57 GiB / 60 GiB avail  k4 c+ K6 k! n$ f
    pgs:     185 active+clean+ k4 U9 v, \# M6 W) C/ C7 u

6 h- Q; S  Q; x% A8 o; K  progress:0 d& X7 w& [) K1 n/ n$ a
    PG autoscaler decreasing pool 5 PGs from 64 to 8 (5m)$ r" n2 V  K8 Y  y3 H: J, B4 v
      [======================......] (remaining: 81s)
2 K" D0 [( ?' Q/ w$ `/ A
/ I# S7 Z4 Y8 Z+ N2 x自动下降到185。因为是虚机下降速度较慢。6 R, k! Q+ p, N3 K6 w) `

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-1-9 09:37:11 | 显示全部楼层
[root@ceph1 ~]# ceph osd pool autoscale-status 0 T: z3 v- y8 }! P# P7 b
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% e2 |( v( p/ ~' u+ w- ]8 k, H
[root@ceph1 ~]# ceph mgr module enable pg_autoscaler
+ k8 s. I8 N. q/ l[root@ceph1 ~]# ceph osd pool autoscale-status
( m1 P9 ?' P$ O  g% x8 _POOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE $ s' I% E; j: b8 I  h! o, J- q
default.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      
2 a. Z& V2 b' z) Z9 {default.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      * k/ C' L: u7 L  l; x
.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      
0 U3 r, \  w3 C& u# eocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn      & U9 a% M3 R6 J+ \" |: Y- U' {
metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      
% l7 g2 V( N+ C; o# O! kdefault.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn        f, g+ f6 Q9 x. u1 b) B. ^
cephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      2 n, M; L* y1 U% t1 J
[root@ceph1 ~]# ceph osd pool autoscale-status
  C: z) j5 ]. vPOOL                  SIZE TARGET SIZE RATE RAW CAPACITY  RATIO TARGET RATIO EFFECTIVE RATIO BIAS PG_NUM NEW PG_NUM AUTOSCALE
: c5 u! Z$ a  ?0 ]default.rgw.meta      857               2.0        1799G 0.0000                               1.0     32            warn      
, x, C# R. h/ b+ ?  h7 ddefault.rgw.control     0               2.0        1799G 0.0000                               1.0     32            warn      : R0 [% W7 h; R+ u2 o& e: N
.rgw.root            3653               2.0        1799G 0.0000                               1.0     32            warn      4 L6 p2 R" ], h, b% r' [7 H0 W7 x  C
ocs                 88467M              2.0        1799G 0.0960                               1.0    128         32 warn        r/ \0 E- D% c& |% }/ ]6 D
metadata             7775               2.0        1799G 0.0000                               4.0     32            warn      5 W, E0 F) B) m- Y, V2 Z! t
default.rgw.log      3520               2.0        1799G 0.0000                               1.0     32            warn      , a3 S7 T% k: R% g
cephfsdata              0               2.0        1799G 0.0000                               1.0     64            warn      
4 ~' ^. k* ^4 I3 K
/ x8 F8 x6 e# Z& A( c
+ x4 z1 L2 ?4 \) _7 f2 l* P8 N* G
. J3 Y1 N! w/ p9 y/ ?/ H
设置目标ratio:$ Q5 f8 `% z) V& v/ p+ k+ `/ x
ceph osd pool set volumes target_size_ratio .8
8 s" R0 L2 S! a5 r6 _6 ^
/ L6 q" O. u2 {# J  A查看是否开启
; s! u* V9 I1 s& o3 q3 O, [3 S[root@ceph1 ~]# ceph osd pool autoscale-status 0 D  [- h- m. x# G
POOL                         SIZE  TARGET SIZE  RATE  RAW CAPACITY   RATIO  TARGET RATIO  EFFECTIVE RATIO  BIAS  PG_NUM  NEW PG_NUM  AUTOSCALE  5 h, u% c# P# |( {' L
device_health_metrics         19                 2.0        61428M  0.0000                                  1.0       1              on         
* K( ~, i8 H5 A' |6 G/ H.rgw.root                   2110                 3.0        61428M  0.0000                                  1.0      32              on         * P4 p4 |( B- `' @; I( E
default.rgw.log             3583                 3.0        61428M  0.0000                                  1.0      32              on         - v: ^' z; x# w4 A, `
default.rgw.control            0                 3.0        61428M  0.0000                                  1.0      32              on         9 x9 g2 E3 z& L1 o
default.rgw.meta             829                 3.0        61428M  0.0000                                  4.0       8              on         1 v: B% s/ u* u4 o& J) G% K0 E+ }, Q- \5 D
cephfs.cephfs.meta         72392                 3.0        61428M  0.0000                                  4.0      16              on         
  I& d# o+ S* K5 i! {7 a; R1 X9 ~cephfs.cephfs.data         131.2k                3.0        61428M  0.0000                                  1.0      32              on         
& }/ I" d- n& X1 \; p: Ldefault.rgw.buckets.index  96810                 3.0        61428M  0.0000                                  4.0       8              on       3 c+ _; J5 r2 q( ]1 l
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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