找回密码
 注册
查看: 1157|回复: 0

ceph存储对osd tree相关的root 和bucket 操作记录过程

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-4-7 09:32:13 | 显示全部楼层 |阅读模式
[root@compute01 ~]# ceph osd tree
  P5 f) A$ \5 GID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF . v1 f/ l" M8 ]/ O
-7       2.00000 root hdd-bigdata                                         
, ^$ G2 q* u! j, Q7 v-14       1.00000     host hdd-bigdata-compute01                           
4 J" l' H' o& n  T* ~ 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
4 p/ |- o* T, ]' e1 U-15       1.00000     host hdd-bigdata-compute02                           3 p, H  t. V& [% l: e
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
' }6 I8 H  e; c" [" {( j-16             0     host hdd-bigdata-compute03                           & i/ `* F- {. s9 l
-6       3.00000 root hdd-smalldata                                       , `6 d8 L( D; B% K7 z! }
-17       1.00000     host hdd-smalldata-compute01                        
7 S; A+ K; {& i; }  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
; a+ u% ^% C/ G2 e-18       1.00000     host hdd-smalldata-compute02                         0 s5 B% W+ N- ]5 k2 B
10   hdd 1.00000         osd.10                       up  1.00000 1.00000
0 {! A6 N  r& o0 ?$ J' Y-19       1.00000     host hdd-smalldata-compute03                        
' r1 m( l) o2 i$ f6 o 11   hdd 1.00000         osd.11                       up  1.00000 1.00000 ! g* i. C" D3 U
-5       3.00000 root ssd-smalldata                                       
' T) C7 F- m& S. Q2 G# W-11       1.00000     host ssd-smalldata-compute01                        
; L* e1 o8 H  N# m/ \, f  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 8 Z. f+ H3 w* v6 F& ]
-12       1.00000     host ssd-smalldata-compute02                        
9 O0 ~, \  o  o5 B2 c" J1 S  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 9 ]" o& C1 w, F( V  F* X; w- R% {$ ^! |
-13       1.00000     host ssd-smalldata-compute03                         ; T4 l8 z8 j: \" j% z
  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 * `( d1 _+ b9 ^* G# M# ]
-4       6.00000 root ssd-bigdata                                         9 [' A: C$ R; p! {1 R( |5 B4 Y
-8       2.00000     host ssd-bigdata-compute01                             ]2 ^& R. F  B3 V  Y8 c. }/ [& c
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
. K3 m7 _, t: q5 t  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 - h$ I/ O" v- @9 x9 G
-9       2.00000     host ssd-bigdata-compute02                           
7 Y) i1 n, M" U6 n$ O" a  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 2 [" z! W0 n2 ?  C4 f  ]9 B! h
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 ( q. I8 e5 A! i6 @. Y1 N
-10       2.00000     host ssd-bigdata-compute03                           
, L# }3 N; S- o/ Y2 _  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
! o  g5 g) L8 Y) X6 A% }  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
: |7 h1 O  R1 k) C6 l -1             0 root default                                             
8 ~) m" R/ h5 v2 X0 e( K+ V& F# q3 g* I2 I) y
+ L1 b6 M0 @. s, ~0 T. T2 ]

. s4 X1 O' e6 _; S( n9 d[root@compute01 ~]# ceph osd  crush rename-bucket ssd-bigdata ssd1 v# F& L8 c$ b, @% ^5 s8 A* X
renamed bucket ssd-bigdata into ssd0 T  Y( _9 @( w/ j& x' H) w$ D. i# q
[root@compute01 ~]# ceph -s( d0 D8 k' c& ^: \& P- {
  cluster:
9 l# W: e' i3 _4 X2 T+ B, l    id:     2af51d38-db90-4a57-a43d-ea9f6ebd74826 p" u' `, F- J* [0 |
    health: HEALTH_OK
  S, T. U1 ^! i1 ?  C
: {0 l, ^4 }: Y6 Y8 O  services:
5 m! l; c6 E3 D  A; A    mon: 3 daemons, quorum compute01,compute02,compute03 (age 17h)
$ L& |* w" J/ ?& y. E' \; ~. Y7 R1 S    mgr: compute01(active, since 17h), standbys: compute02, compute03
0 E% Y8 V; b' x: n2 n  F2 ^    osd: 14 osds: 14 up (since 16h), 14 in (since 16h)
7 Z6 O3 v3 F$ d; `
" t; J9 q' o) R) q! {  data:
2 }6 U1 k( l% V3 O4 Y8 n8 Z" Q    pools:   0 pools, 0 pgs+ `% m2 z* |! x$ h$ U, T- U2 g
    objects: 0 objects, 0 B& Z; b1 Q# n& A4 @3 M' V8 q2 w
    usage:   14 GiB used, 13 TiB / 13 TiB avail
% h$ y+ Z3 F' P    pgs:     
. E8 T3 ]* w# g ( T0 k% H0 {; D1 k
[root@compute01 ~]# ceph osd tree; E" `: z3 L# U
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
4 M+ j+ c+ `9 p% t6 q -7       2.00000 root hdd-bigdata                                         9 S$ {- s" N* M
-14       1.00000     host hdd-bigdata-compute01                           
. C# i: Q: l! ~9 I 12   hdd 1.00000         osd.12                       up  1.00000 1.00000 # `" s9 y% X9 \1 Y
-15       1.00000     host hdd-bigdata-compute02                           5 I3 Z. R$ ?( d' a/ x
13   hdd 1.00000         osd.13                       up  1.00000 1.00000 1 \7 O" L0 j0 g# D
-16             0     host hdd-bigdata-compute03                           8 f& [3 h  f) b. I0 S  U' G" D3 A
-6       3.00000 root hdd-smalldata                                       
+ m. T) q# \8 _5 x5 m3 S" h-17       1.00000     host hdd-smalldata-compute01                         4 W- t6 _6 s2 e' [1 U3 Z
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 * e! z; x! i$ N
-18       1.00000     host hdd-smalldata-compute02                         4 P# `' z, H6 U* d
10   hdd 1.00000         osd.10                       up  1.00000 1.00000 . @3 H+ F4 \& M1 C( J
-19       1.00000     host hdd-smalldata-compute03                         % `  A  y' \* f1 a
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 * T8 F. t5 _( J( k* V0 ?4 L
-5       3.00000 root ssd-smalldata                                       5 I) [* a8 H& Q2 j
-11       1.00000     host ssd-smalldata-compute01                        
2 O. w, W' J8 k7 d0 {  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 - ]" Q. ?( j7 r- Q! J7 l: z
-12       1.00000     host ssd-smalldata-compute02                        
& J; s' b" N) I9 [- _9 p0 C  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 7 x. T2 P6 L7 ^/ }9 \/ k
-13       1.00000     host ssd-smalldata-compute03                        
* E4 |0 S" r3 a  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
$ {# x7 V  n3 O" J/ n! C& l+ B -4       6.00000 root ssd                                                 / \$ |, [( A! I3 a
-8       2.00000     host ssd-bigdata-compute01                           
1 _; w9 s0 Z: n% n  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
  V8 Q7 N) }5 q. E4 W  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 ' D& m' |2 _) k: ^" T* z6 Y
-9       2.00000     host ssd-bigdata-compute02                           
( ?. X) D) H! I; F6 z9 g  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
1 G6 i. L- L9 b, y  3   ssd 1.00000         osd.3                        up  1.00000 1.00000
) h# a; i5 }) l$ ?3 |+ S" k+ g-10       2.00000     host ssd-bigdata-compute03                           
3 [! e+ v) P) y0 s7 y; p  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
2 ]+ d6 e8 l! ~. v; u4 e  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
3 a/ f! L* q) {: T1 o' g& n4 N -1             0 root default                                             6 M. e6 }) f" D! E

. s' {8 [) G: z: Y
" O* v, L# B) X; P4 n4 `/ J
( }2 U) u6 R# M, O* o0 k[root@compute01 ~]# ceph osd crush --help 5 J# h( V/ o- m# U6 W6 `4 X
General usage: : b$ A: i! A* R$ x5 S+ m. I5 \0 L$ z
==============
; l, ^! C* M# U) gusage: ceph [-h] [-c CEPHCONF] [-i INPUT_FILE] [-o OUTPUT_FILE]
- o; b& k$ s8 d            [--setuser SETUSER] [--setgroup SETGROUP] [--id CLIENT_ID]5 J4 x# w3 w" b6 t
            [--name CLIENT_NAME] [--cluster CLUSTER]
0 g0 J  }' n# k" i: g$ N: l8 N8 i            [--admin-daemon ADMIN_SOCKET] [-s] [-w] [--watch-debug]
) B( b1 ~1 l1 g9 A! h            [--watch-info] [--watch-sec] [--watch-warn] [--watch-error]8 N3 J; q; V& K* L! q' y
            [--watch-channel {cluster,audit,*}] [--version] [--verbose]4 _! o! k3 f4 x$ B& _( S% S
            [--concise] [-f {json,json-pretty,xml,xml-pretty,plain}]. n# {1 @4 {6 \+ H! S
            [--connect-timeout CLUSTER_TIMEOUT] [--block] [--period PERIOD]
/ Y( c! j/ N! WCeph administration tool
' ]% k) d, l7 Uoptional arguments:
2 K% W* X" H, m7 {1 k" Y2 n4 W/ F  -h, --help            request mon help
0 e7 K, @( m! P( i2 s2 I6 I  H( ]  -c CEPHCONF, --conf CEPHCONF
4 }) P  Z. l" l" I& M                        ceph configuration file
# `, b. ~' v* z7 U$ [; @  -i INPUT_FILE, --in-file INPUT_FILE
2 S  F2 A4 W9 [8 K* G                        input file, or "-" for stdin! x( b& D) _$ a. p
  -o OUTPUT_FILE, --out-file OUTPUT_FILE# U+ G7 v& U) ], m1 E1 E1 F5 A
                        output file, or "-" for stdout- |4 I6 }0 o( c- h  D: P. K! h
  --setuser SETUSER     set user file permission7 c/ l9 ~! ^8 J6 p; V) h
  --setgroup SETGROUP   set group file permission/ e0 |+ k4 p% m1 T
  --id CLIENT_ID, --user CLIENT_ID
! ~* [4 {5 p+ n* ]& {- I/ H                        client id for authentication
+ X6 g0 e: y2 _8 m  q' l: z  --name CLIENT_NAME, -n CLIENT_NAME0 e; q7 Q4 t; K+ |3 u& }1 c
                        client name for authentication
8 T; T% U! Z& j! y2 _  --cluster CLUSTER     cluster name) O- e$ I4 X: ~( V) w% m0 f
  --admin-daemon ADMIN_SOCKET
" n' m$ `8 J0 J( s% T+ T. h                        submit admin-socket commands ("help" for help% g( W/ D; U% o* X& H, d
  -s, --status          show cluster status1 ~! Z- r& K* P" J
  -w, --watch           watch live cluster changes4 s3 v% T! C( h) d& n2 q
  --watch-debug         watch debug events
& n) T5 ?% F( W; N) x& N' O  --watch-info          watch info events6 o5 L3 s' y- Q' m6 M8 x
  --watch-sec           watch security events
* w( ^  h5 I, ]# s, G1 g  --watch-warn          watch warn events6 M$ k# ?3 m7 z- K. v! z" A
  --watch-error         watch error events2 p3 p& V: J1 h
  --watch-channel {cluster,audit,*}1 x& `" A2 i2 _0 t8 F/ Q5 O% t
                        which log channel to follow when using -w/--watch. One
# a% {* R9 t' ^8 l$ s7 T                        of ['cluster', 'audit', '*']( U  D3 c6 l  t# t3 P- k
  --version, -v         display version- V& }8 L/ U  T( k; v
  --verbose             make verbose
+ [' E8 J6 h) w! n# F  --concise             make less verbose
: M# S$ F& V- f$ W0 X  -f {json,json-pretty,xml,xml-pretty,plain}, --format {json,json-pretty,xml,xml-pretty,plain}
( V5 W! ^; M' [$ w4 b/ C8 Y% \  --connect-timeout CLUSTER_TIMEOUT  N$ d9 A4 P! z% l
                        set a timeout for connecting to the cluster6 A9 x+ z+ X+ A  l6 P
  --block               block until completion (scrub and deep-scrub only)0 p+ G' y: b: \$ n* @! k
  --period PERIOD, -p PERIOD
6 n8 V9 H* ~* U+ m4 I/ [$ r                        polling period, default 1.0 second (for polling
) H3 m0 I2 z9 G) k                        commands only)
5 d' H; U9 @* r4 c( U) A$ Q Local commands:
1 h. c" p0 c; I- {. c ===============& v3 T7 J5 Q/ {& |
ping <mon.id>           Send simple presence/life test to a mon! m6 v9 u0 z- O2 v+ o) s
                        <mon.id> may be 'mon.*' for all mons
* K. }5 \1 p; t# K9 y/ f9 c5 ~( fdaemon {type.id|path} <cmd>
! C$ z* ^2 S/ C0 N* Q                        Same as --admin-daemon, but auto-find admin socket3 L; u/ g! z' q9 g. O: J* O
daemonperf {type.id | path} [stat-pats] [priority] [<interval>] [<count>]" m# ^4 K2 @5 g* y
daemonperf {type.id | path} list|ls [stat-pats] [priority]
: R* }# G, e; ^" B: u0 q' H, }4 ]                        Get selected perf stats from daemon/admin socket
  U. l7 q! Z7 Y( e                        Optional shell-glob comma-delim match string stat-pats% i4 F" Y) P$ ^8 {
                        Optional selection priority (can abbreviate name):5 E! K! C5 s3 p/ E/ ~
                         critical, interesting, useful, noninteresting, debug0 k7 t$ w6 B/ c' q: P
                        List shows a table of all available stats, E8 j1 K, z/ P5 `
                        Run <count> times (default forever),
& ]3 ~. G! E/ [: N  ?; m$ R                         once per <interval> seconds (default 1). {; H# k7 r; |+ f8 |. f
   
* e4 [  r" Q" a Monitor commands:
/ _: S3 Y5 i- O8 B4 N3 {; |* d  D =================5 S8 H, n3 a( M3 r2 G! k" v* u4 A
osd crush add <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]              add or update crus9 K9 e$ X) u' F' i" ^4 r( E
                                                                                   <args>
, ^4 W9 _/ @( f3 j3 f( V* l0 posd crush add-bucket <name> <type> {<args> [<args>...]}                           add no-parent (pro
/ C8 r- R' U. c                                                                                   <args>* u1 b: @  f$ e! M4 j7 A) f
osd crush class create <class>                                                    create crush devic" Z1 P" \4 \/ o6 x$ ~+ k( h
osd crush class ls                                                                list all crush dev
& }. y2 w5 ^  Cosd crush class ls-osd <class>                                                    list all osds belo4 r8 h+ v( K/ Q3 w8 F* D7 _
osd crush class rename <srcname> <dstname>                                        rename crush devic
3 u$ ]) l6 W& K0 G! Vosd crush class rm <class>                                                        remove crush devic: C8 K* J0 h5 i: h  x" B
osd crush create-or-move <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]   create entry or mo
* a3 W: h& \/ ?  E7 hosd crush dump                                                                    dump crush map
# J' N1 r0 q! M& o1 O: K4 kosd crush get-device-class <ids> [<ids>...]                                       get classes of spe, P* C" H7 h9 G! v
osd crush get-tunable straw_calc_version                                          get crush tunable
& m' w% @4 n% n* ~osd crush link <name> <args> [<args>...]                                          link existing entr
8 e. M4 L( p  l8 \: qosd crush ls <node>                                                               list items beneath
8 d6 _4 y& ]$ e/ K5 O  i4 G. bosd crush move <name> <args> [<args>...]                                          move existing entr+ M: q& c, S+ h/ L9 ?( X
osd crush rename-bucket <srcname> <dstname>                                       rename bucket <src
0 H/ Z+ J  I8 Q  V' w/ j: gosd crush reweight <name> <float[0.0-]>                                           change <name>'s we
2 a- |# j! }' r$ Q: k- mosd crush reweight-all                                                            recalculate the we$ |+ A+ U$ {4 P6 W
osd crush reweight-subtree <name> <float[0.0-]>                                   change all leaf it
1 ^1 r2 Y: n4 `- y. yosd crush rm <name> {<ancestor>}                                                  remove <name> from$ [) _  D, [, K( G7 r
osd crush rm-device-class <ids> [<ids>...]                                        remove class of th  ^" U+ }1 m1 q1 {2 V# ]
osd crush rule create-erasure <name> {<profile>}                                  create crush rule # G2 f) x+ K/ A9 r( R0 p
                                                                                   default)9 x' l) z  T( G1 D2 ?
osd crush rule create-replicated <name> <root> <type> {<class>}                   create crush rule 2 B9 c5 J% ^1 R9 r, h3 [$ P
                                                                                   across buckets of# N* z2 t9 U( m& i. x
osd crush rule create-simple <name> <root> <type> {firstn|indep}                  create crush rule 4 F" t! J% ^8 o: Z  a
                                                                                   <type>, using a c' T5 ~2 ~4 N0 @+ T" k6 T' O" c: }
                                                                                   erasure pools)" s( s( @' f- |1 N4 l+ h* D& p
osd crush rule dump {<name>}                                                      dump crush rule <n+ n0 T& l- t" ]$ C
osd crush rule ls                                                                 list crush rules
' Z4 `( ]" V: _* P+ B# W1 yosd crush rule ls-by-class <class>                                                list all crush rul
' L7 ~+ C1 M8 S; josd crush rule rename <srcname> <dstname>                                         rename crush rule . [" \. k% W4 L3 n, B; w6 x
osd crush rule rm <name>                                                          remove crush rule " n4 X3 p' L. `" M9 y# Q, L
osd crush set <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]              update crushmap po1 @7 g) s5 f. h. L( b, K
osd crush set {<int>}                                                             set crush map from
, L8 i5 N  x6 t1 \osd crush set-all-straw-buckets-to-straw2                                         convert all CRUSH
9 Q0 Z6 n4 O' `/ O* Tosd crush set-device-class <class> <ids> [<ids>...]                               set the <class> of, {' G4 D3 Y8 V/ t4 w
osd crush set-tunable straw_calc_version <int>                                    set crush tunable
) l/ O  K8 y& s" kosd crush show-tunables                                                           show current crush( X# [$ {% ?0 a5 d3 z
osd crush swap-bucket <source> <dest> {--yes-i-really-mean-it}                    swap existing buck) q2 [& }3 c. Y& E+ q" `% x# ^
osd crush tree {--show-shadow}                                                    dump crush buckets
+ Q& H) W1 J; H6 @4 q/ \& I- mosd crush tunables legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default   set crush tunables6 U# r1 a, ?1 c0 I
osd crush unlink <name> {<ancestor>}                                              unlink <name> from
" _! n* M+ ^: l8 f) b2 f6 a) M: Xosd crush weight-set create <poolname> flat|positional                            create a weight-se6 x2 |! q" m' @3 M. p% i
osd crush weight-set create-compat                                                create a default b( `7 E) u5 ]0 g% X. r
osd crush weight-set dump                                                         dump crush weight
, G0 T* I% ?% ]: N# _$ U) nosd crush weight-set ls                                                           list crush weight
6 y4 \; A! |( v- u- Wosd crush weight-set reweight <poolname> <item> <float[0.0-]> [<float[0.0-]>...]  set weight for an 3 q7 `2 H. Q6 I0 y3 A9 t" U- m2 a
osd crush weight-set reweight-compat <item> <float[0.0-]> [<float[0.0-]>...]      set weight for an
5 i1 o2 l  q) \osd crush weight-set rm <poolname>                                                remove the weight-" I: M1 B+ v# U& r! [; f
osd crush weight-set rm-compat                                                    remove the backwar
' ], i1 X0 g; x0 U0 f! V[root@compute01 ~]# ceph osd crush class
+ d. M5 X, t- z7 s3 X* Y4 Dcreate  ls      ls-osd  rename  rm      $ a' I- W! a2 m! Z, r' @/ B! h
[root@compute01 ~]# ceph osd crush class ! i  L! g/ ~7 o& _4 i8 M
create  ls      ls-osd  rename  rm      
4 c7 ^6 G  L6 y4 y% p0 r  }8 |[root@compute01 ~]# ceph osd crush class ls
+ a5 W6 w% ]" Z7 W8 _7 n4 {[
$ G$ k4 }" V: r( M  z7 e; C    "ssd",9 e0 m* b; R. j) h) o: H/ t/ E
    "hdd"
6 N+ t- f- g/ |5 ]0 R# k5 n]+ _2 d: M2 V7 X: T

$ i7 _! J5 C2 l$ g[root@compute01 ~]# ceph osd crush rename-bucket : m+ x) o1 n# b; A- P- U3 p
                                       #rename bucket <srcname> to <dstname>  
6 r: h* r' Y1 k* ~+ ]3 t2 y$ {! `
: n5 p7 |7 q6 v: F; K7 }8 V[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute01 ssd-compute01
+ S1 k! y. g; D" A" Qrenamed bucket ssd-bigdata-compute01 into ssd-compute01
  Q' }' f, N  }) p[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute02 ssd-compute02
0 u# \7 k% c# v* {: xrenamed bucket ssd-bigdata-compute02 into ssd-compute021 P* f* a4 n* Y% y; r& q  N
[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute03 ssd-compute03
( R9 }) }( F1 Grenamed bucket ssd-bigdata-compute03 into ssd-compute03. m7 Q7 W4 g- W9 ]  H4 w; S
2 E4 u' w8 @. k4 s6 I, [
[root@compute01 ~]# ceph osd tree
8 L: y  y5 M0 P! f; k1 bID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
+ G& z6 D# A, P  t+ m# [ -7       2.00000 root hdd-bigdata                                         
3 T/ X2 X# _9 ^# c& N3 @& {-14       1.00000     host hdd-bigdata-compute01                           5 O8 b: l* V$ Y" i, U
12   hdd 1.00000         osd.12                       up  1.00000 1.00000
" V7 M; B, k4 p! r5 u) ^0 H-15       1.00000     host hdd-bigdata-compute02                           0 K( x7 u0 }, U* w
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
1 I5 x1 {7 T6 d5 h# P6 p! k; C-16             0     host hdd-bigdata-compute03                           
( v0 u6 P% T- W' B4 J: G2 C4 L% T -6       3.00000 root hdd-smalldata                                       
/ s! W6 J( d# T, K( |. x-17       1.00000     host hdd-smalldata-compute01                        
: Z* I' h/ |4 P- U% t  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 + A) {! C" c  H  y7 Q5 d
-18       1.00000     host hdd-smalldata-compute02                         3 f: |+ D$ F! S2 {6 _
10   hdd 1.00000         osd.10                       up  1.00000 1.00000
8 {$ V/ O. ]! g6 \( C8 F$ u1 P' ?-19       1.00000     host hdd-smalldata-compute03                        
/ b( h9 E" X9 e8 c1 K0 T 11   hdd 1.00000         osd.11                       up  1.00000 1.00000 0 P# C# ?# s/ [. H
-5       3.00000 root ssd-smalldata                                       2 J+ n- u6 A$ B; b5 I* z' u" U& X
-11       1.00000     host ssd-smalldata-compute01                        
; w( ?1 A. c. ]. n& M7 J; n5 W' Q  6   ssd 1.00000         osd.6                        up  1.00000 1.00000
5 u  x2 p  S9 \% j7 w-12       1.00000     host ssd-smalldata-compute02                        
( [9 D4 T- E2 D. x  ]$ }9 m3 e  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 & r$ U+ m# `7 {. n/ b- ^
-13       1.00000     host ssd-smalldata-compute03                           t7 x( p: `. Z9 G! y! V
  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 ! l! b3 Q3 J% `: K. n( s* X
-4       6.00000 root ssd                                                
+ }! ?+ B0 d, W  p0 y; ^: v -8       2.00000     host ssd-compute01                                   9 h0 a6 r( S9 k! Q9 g2 e
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000 / P" n5 ?" A' ]( x1 i9 j
  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 - t8 B! L- G# t, E/ T* o0 n
-9       2.00000     host ssd-compute02                                   
' Z7 V+ \. L% K" G' }/ P  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 , q4 G0 p% X& `% S, S2 E- [) F
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 ( i1 j& h5 D" T$ K: j
-10       2.00000     host ssd-compute03                                   
1 E0 k( |" ^0 X# K) j% H  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
) V3 [5 ?) @( m, H% k  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
8 N! _& y+ ~; a) @- F5 D0 Q. o* B: D -1             0 root default                                             7 t3 J# S/ ^; j& |
[root@compute01 ~]# ceph osd crush rename-bucket ssd-smalldata-compute01 ssd-compute01
$ T' j) k& \- G# vError EEXIST: dstname = 'ssd-compute01' already exists1 {$ |) |, g/ p4 v. q$ u% L
[root@compute01 ~]# ceph osd tree5 s: n: [! n" ~! n% Z) N  h: N9 G6 o
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
' R- _6 P% N: H/ e# H* J( |2 R8 Q8 a -7       2.00000 root hdd-bigdata                                         7 j6 Q( s1 S5 R8 G) n. y
-14       1.00000     host hdd-bigdata-compute01                           / w' X% C$ f4 @, s8 V3 u
12   hdd 1.00000         osd.12                       up  1.00000 1.00000 3 Y+ @& O& H# |) e8 Z7 _4 j7 ~
-15       1.00000     host hdd-bigdata-compute02                           
* P. s5 v8 m1 _ 13   hdd 1.00000         osd.13                       up  1.00000 1.00000
9 f# H( n3 ?- w. A& O3 P-16             0     host hdd-bigdata-compute03                           + B- K/ c/ D1 |) I" T  U' Z$ u" @
-6       3.00000 root hdd-smalldata                                       
" r, W, L$ z3 ?. y* p6 s) S-17       1.00000     host hdd-smalldata-compute01                         ' M1 e, Y8 H: _" s8 Z
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
/ l, B, _- o/ o- [; M! q! m9 C-18       1.00000     host hdd-smalldata-compute02                        
  |2 j$ j& x4 w6 s2 {  E 10   hdd 1.00000         osd.10                       up  1.00000 1.00000
. [6 o5 n" N6 `; A1 ~-19       1.00000     host hdd-smalldata-compute03                         * ?; o! z6 w$ |3 O- z; v
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 4 y  U) L* K+ ?, Q
-5       3.00000 root ssd-smalldata                                       
% L7 i$ S9 w1 ^% l-11       1.00000     host ssd-smalldata-compute01                        
1 y/ j, v1 H8 y) [. I8 C5 G  6   ssd 1.00000         osd.6                        up  1.00000 1.00000   N9 }) b; g5 r! M
-12       1.00000     host ssd-smalldata-compute02                        
  i5 r8 A2 V( i5 M  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
- m$ Y  o8 E1 M5 i1 Y: W-13       1.00000     host ssd-smalldata-compute03                        
- Z" @' n% X6 ]) ^0 x& {; T6 X$ L  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 ' S& |# z+ w8 f1 `& f
-4       6.00000 root ssd                                                
' w' P% k. Z0 a1 _0 C4 p -8       2.00000     host ssd-compute01                                   
: X0 N( B. c* a, T, b  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
0 v- `0 _. L6 y; @9 H) T& Y* r* Q. w  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
( V9 j! @1 @7 A -9       2.00000     host ssd-compute02                                   - q: T7 T% y4 c( e7 p, F
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
( @; }, r% N  o% T9 j  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 ; d9 X% v0 O0 n" o7 c0 s
-10       2.00000     host ssd-compute03                                   , A  T6 U6 }5 y. j5 o
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
3 j2 f2 \3 T# a8 H& C7 `: r% c  5   ssd 1.00000         osd.5                        up  1.00000 1.00000 1 {1 c' ^' {8 _5 _) L
-1             0 root default                                             : y, ~) r9 \* N9 k
[root@compute01 ~]# ceph osd crush / r' J. W, I; i/ F2 _1 M) s( i
add                              remove                           set-device-class
" l& P  h( P% ~; i% o0 xadd-bucket                       rename-bucket                    set-tunable% g6 Q$ C" ?% E) b
class                            reweight                         show-tunables* i' {* u8 y6 x- Q& s$ h, a* N$ j" ~8 D
create-or-move                   reweight-all                     swap-bucket  k& J! Y: s6 S2 p: y* a' I
dump                             reweight-subtree                 tree0 n& t1 J2 V7 p; d, ]
get-device-class                 rm                               tunables
0 l# ^2 k& m' c7 f4 }/ Y# Qget-tunable                      rm-device-class                  unlink$ H3 d+ f2 m& ~0 t. H  T
link                             rule                             weight-set
! u: k0 `1 F+ e; d) \2 xls                               set                              
& V/ A5 ~  \1 }/ A( nmove                             set-all-straw-buckets-to-straw2  
, }& w1 J( \) o# e- z[root@compute01 ~]# ceph osd crush  set osd.6 1.00000 host=ssd-compute01; @& s, h6 o6 l7 h' p
set item id 6 name 'osd.6' weight 1 at location {host=ssd-compute01} to crush map
, B; m; U# Z1 b  X: r0 m$ a[root@compute01 ~]# ceph osd crush  set osd.7 1.00000 host=ssd-compute02
& ^  D# a4 t! Y/ N4 D2 z2 i9 Wset item id 7 name 'osd.7' weight 1 at location {host=ssd-compute02} to crush map2 x0 ~4 x4 B$ B; g& O+ w/ U  `
[root@compute01 ~]# ceph osd crush  set osd.8 1.00000 host=ssd-compute03
. p! l) ~/ _! ^  l* |# k$ Y9 k- cset item id 8 name 'osd.8' weight 1 at location {host=ssd-compute03} to crush map
( O: N, E3 N$ F[root@compute01 ~]# ceph osd tree, t* R4 `) S+ M. n1 a) K8 N& @
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF : \' W# }* j  a; I! ]6 y+ j. G
-7       2.00000 root hdd-bigdata                                         ' j7 K1 c) G4 u
-14       1.00000     host hdd-bigdata-compute01                           
) N7 d) K6 p. g5 w8 }+ b8 { 12   hdd 1.00000         osd.12                       up  1.00000 1.00000 : N- `: g; X# @; Z+ T+ m% q
-15       1.00000     host hdd-bigdata-compute02                           ! K4 v/ _  F1 I6 c& [  e9 S' b5 X
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
+ Q4 G+ P9 @2 Q! q-16             0     host hdd-bigdata-compute03                           ; A* j% @" |+ P" j4 k, u% y9 O0 H
-6       3.00000 root hdd-smalldata                                       
5 Z% R+ i8 n; q* `-17       1.00000     host hdd-smalldata-compute01                        
* N/ g0 y3 h$ L* ^4 p  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
7 o* p6 q" t# B* n2 F-18       1.00000     host hdd-smalldata-compute02                        
7 \& W* M! C7 ^/ l9 E 10   hdd 1.00000         osd.10                       up  1.00000 1.00000
( @2 S3 O. P0 s-19       1.00000     host hdd-smalldata-compute03                         " u6 A) Y8 x3 O2 y/ q4 a
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 * L! l: |: M& f
-5             0 root ssd-smalldata                                       
# t* A6 P' s5 X: L: ~% Y-11             0     host ssd-smalldata-compute01                         3 C6 k3 ?' {( \: [! u: V/ c/ b3 v
-12             0     host ssd-smalldata-compute02                        
1 U: G! {. h; k-13             0     host ssd-smalldata-compute03                         + |# l. h- X: V, P# C
-4       9.00000 root ssd                                                 # s2 m2 t7 A1 b+ _- \
-8       3.00000     host ssd-compute01                                   
- D6 X* J2 h& i& f/ z- E. @  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
1 s; s& n/ I! N3 }" r5 S+ ~  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 # m; j# f  m; T( Z
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 4 |) [; x0 K2 I" r% g
-9       3.00000     host ssd-compute02                                   
/ B& p0 N$ n  F  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
0 x9 X1 Z* {) g3 a" [0 @+ x5 f  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 + t" |8 K  W9 l! @# D
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
$ k; Z* _4 Q. v+ G! K4 f6 a$ c) Q-10       3.00000     host ssd-compute03                                   % p( |- R" t# U  E
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000 5 ~3 L+ j5 |: z3 `# D9 m
  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
( P$ @0 l1 \% J0 `% R, ^  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 3 B( H) h1 Y3 J/ [; C$ s! Q) C& D. s
-1             0 root default                                             
% R: A3 ]- K) p# s) v: {[root@compute01 ~]# df -TH
' l7 [& O4 F1 v% d: U6 }Filesystem              Type      Size  Used Avail Use% Mounted on
. U& b& z; M3 Vdevtmpfs                devtmpfs   68G     0   68G   0% /dev
$ l# |2 O# D& o  X2 [" otmpfs                   tmpfs      68G     0   68G   0% /dev/shm, V, _1 W# {- ]9 o4 `# o: V8 w
tmpfs                   tmpfs      68G  9.8M   68G   1% /run
8 s5 y  e! d7 @1 ~7 ~4 i! D1 Jtmpfs                   tmpfs      68G     0   68G   0% /sys/fs/cgroup
) T' m0 m1 G: @4 d: [* ~/dev/mapper/centos-root xfs       582G  2.8G  579G   1% /
, Y$ s, z% ~" h7 d/dev/sda1               xfs       1.1G  158M  907M  15% /boot5 B# ?( i5 O+ |0 @( L8 o
tmpfs                   tmpfs      14G     0   14G   0% /run/user/05 G+ n  {3 Y$ o+ s
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-0
8 E$ a/ P2 _; P+ L$ \* B  o% Y! Stmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-1
+ z9 I2 H$ Q6 v; A0 h2 ptmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-6* Y2 J% R/ w% @/ y- |8 ?4 K
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-99 |  O4 r0 z5 I' ?. P" S! t
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-12$ G& y1 u- K4 c2 X7 V1 v
[root@compute01 ~]#
$ b* e# l+ t  o: U: c[root@compute01 ~]#
6 S6 O7 c; @6 ]8 b5 r[root@compute01 ~]# ( [1 o; O8 O' |3 K. f$ e
[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute02
0 V2 v" a, u4 Tremoved item id -12 name 'ssd-smalldata-compute02' from crush map
, c% R- W2 r0 A, G3 p0 w[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute01 + v! d* F4 \9 _8 J
removed item id -11 name 'ssd-smalldata-compute01' from crush map8 }% ?/ g# p( o% T9 P
[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute03 2 t) i* `# \9 }7 ]4 W- }6 X
removed item id -13 name 'ssd-smalldata-compute03' from crush map
4 _/ {( @+ `3 {7 k( O% @0 E[root@compute01 ~]# ceph osd crush remove ssd-smalldata
4 W  F7 f( X/ x( S8 k. p1 M; G$ }" uError EBUSY: (16) Device or resource busy
+ X' @$ H, }# p7 ?[root@compute01 ~]# ceph osd tree3 g' {: o0 ^. T$ i
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
; Y: M6 B/ `/ i0 Z -7       2.00000 root hdd-bigdata                                         
+ l3 }' V) z7 _, q0 X4 L) K-14       1.00000     host hdd-bigdata-compute01                           + F, ^6 l2 _+ @  ^
12   hdd 1.00000         osd.12                       up  1.00000 1.00000 6 o8 I9 _( v, F/ W% ]; ]
-15       1.00000     host hdd-bigdata-compute02                           * |( g0 U( m% z( z
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
  M# e9 p# o+ C8 }-16             0     host hdd-bigdata-compute03                           
) h) e( l% }$ z+ D, C: e -6       3.00000 root hdd-smalldata                                       0 }9 q1 {, H1 u$ h
-17       1.00000     host hdd-smalldata-compute01                        
: v! Y" j+ j9 A; w  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
4 o* c2 E/ ~- r" U. d7 w-18       1.00000     host hdd-smalldata-compute02                         ' p4 f- }7 F1 |8 y! Z8 p
10   hdd 1.00000         osd.10                       up  1.00000 1.00000
3 n9 h. y3 h6 Q, j( X5 C-19       1.00000     host hdd-smalldata-compute03                        
6 W/ [5 j# ?5 _: C7 u 11   hdd 1.00000         osd.11                       up  1.00000 1.00000 ; V* {+ U1 l$ C9 U
-5             0 root ssd-smalldata                                       
3 O' N2 f9 J- T) C$ }" J) Y6 w -4       9.00000 root ssd                                                 ; ~( F/ x0 K, a2 x) i" |; v& O! D
-8       3.00000     host ssd-compute01                                   
3 f2 c1 q8 K7 [* p  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
& E5 r# W, I  K/ |- K4 |  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 & f5 K$ r7 j# {! o
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 1 a+ h8 E8 a/ ]6 v5 `! P
-9       3.00000     host ssd-compute02                                   & a# g& |  B9 g2 D& q/ `
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
/ A+ _' f! C* J  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 5 O# \3 @7 @! m1 `0 d
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
; j$ c! q% S- k4 G2 z3 Z# B/ i-10       3.00000     host ssd-compute03                                   # K( k4 j# z( B5 a7 l
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
: d1 v- ~8 A7 m! n$ C" o$ n8 t  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
, u+ m# N% j; m# l. j  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
9 b! L& p5 Z# l6 a4 @# n9 J0 `( i -1             0 root default                                             , a' K" x2 g  A3 h9 o2 }6 K
[root@compute01 ~]#
6 u/ v2 u$ s9 c
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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