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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-4-7 09:32:13 | 显示全部楼层 |阅读模式
[root@compute01 ~]# ceph osd tree  H( n. Z8 e' m/ @
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF 8 ^; d! X; z. A/ u
-7       2.00000 root hdd-bigdata                                         . \' q+ t. ?5 [  d+ @
-14       1.00000     host hdd-bigdata-compute01                           
2 u6 L! @. v: w4 S2 r 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
/ ?& I6 V1 M- H$ w/ t-15       1.00000     host hdd-bigdata-compute02                           
, ^+ q& }0 D  P; u% D  I6 V7 n- S 13   hdd 1.00000         osd.13                       up  1.00000 1.00000
# P* W% ?% A& Y& }* b& W, y-16             0     host hdd-bigdata-compute03                           , g  S. u) P$ e3 v' X
-6       3.00000 root hdd-smalldata                                       
; v0 P  p* h5 g( p+ x-17       1.00000     host hdd-smalldata-compute01                        
2 N( R  N  L- F6 n& o8 K2 t! O  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
5 `3 X7 @9 x" I5 v3 Y) X9 W0 c-18       1.00000     host hdd-smalldata-compute02                        
- c) a$ G: ?4 s- M( I! N, }& A5 R* H 10   hdd 1.00000         osd.10                       up  1.00000 1.00000 # Q4 D8 }3 {' v+ P- }
-19       1.00000     host hdd-smalldata-compute03                        
2 B8 P& K% F$ A9 @6 z 11   hdd 1.00000         osd.11                       up  1.00000 1.00000 ( t2 T" t% b; t& |
-5       3.00000 root ssd-smalldata                                       
3 [" W$ t% n1 D' @3 }& }8 B4 J-11       1.00000     host ssd-smalldata-compute01                        
6 o* L* \4 w5 G7 m/ V: N+ V$ m, Z  x  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 ! ^. c% Z: |& V: a8 P5 E+ ]
-12       1.00000     host ssd-smalldata-compute02                         7 z4 F0 F: q$ ^6 \
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
8 R% e: @) c2 c( v3 S2 @-13       1.00000     host ssd-smalldata-compute03                         4 t& O3 j7 s9 x2 q6 w
  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 ' A2 |) r" l" H, x" q
-4       6.00000 root ssd-bigdata                                         1 v5 O: P# y) [& ]
-8       2.00000     host ssd-bigdata-compute01                           
& g4 E# g, A" h! |# m8 z  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
/ |2 f! f. l( E( m% z  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 7 b8 x. S# t  C
-9       2.00000     host ssd-bigdata-compute02                           
9 m6 }/ U$ _. v3 G8 D/ `  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
* n$ K" G, [- i0 a+ O9 p  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 5 N6 O. S2 p6 L5 c
-10       2.00000     host ssd-bigdata-compute03                           
9 t) }/ ]1 W$ s. S( ]  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
+ `- m3 \- t, u3 T  5   ssd 1.00000         osd.5                        up  1.00000 1.00000 4 m" W$ j1 l5 |& T) F
-1             0 root default                                             - \' n* x  g* K; S- k8 O

. p1 {+ Q% k2 i: x5 G# ?4 O. _
7 M" E1 a( J0 J. g: Y' m8 {
/ Z* j" e4 g$ A0 a! _[root@compute01 ~]# ceph osd  crush rename-bucket ssd-bigdata ssd
" ?* A; `9 S$ D" o* Urenamed bucket ssd-bigdata into ssd+ s6 b" u; s6 y, n
[root@compute01 ~]# ceph -s7 f- S% P: e1 d6 m: ]  I  J, |
  cluster:$ o3 I7 L9 z1 |( o! u
    id:     2af51d38-db90-4a57-a43d-ea9f6ebd7482
! V4 x2 F% @$ b9 G4 K6 C  `    health: HEALTH_OK
3 R/ o" o! _8 s1 A$ J; p
5 q  R5 t: q/ q7 T- n% Q  services:1 Z! Z$ E, j, s
    mon: 3 daemons, quorum compute01,compute02,compute03 (age 17h)7 J8 D+ E' l5 v' h$ C$ B
    mgr: compute01(active, since 17h), standbys: compute02, compute03
/ p  F) V% z1 F    osd: 14 osds: 14 up (since 16h), 14 in (since 16h)
- x, Q9 z/ Q# @  A* H: V
% F7 q+ B- A3 ~. I9 m  data:
( y3 F; M- \7 ^+ t4 k! ~    pools:   0 pools, 0 pgs
# {. D' Z) |" k( U" h9 W7 X5 m) c- {    objects: 0 objects, 0 B8 m) \( M3 E( [
    usage:   14 GiB used, 13 TiB / 13 TiB avail1 I1 q4 g' g6 [1 t: _
    pgs:     
& W/ Y& j+ {+ o# m* Z 9 r, ]1 M: g2 h* Q$ }' Q4 D2 W; y
[root@compute01 ~]# ceph osd tree8 Q2 f" y) r  S; e/ R0 U: G
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
; C5 L( y$ \. q4 N -7       2.00000 root hdd-bigdata                                         
8 I$ a. i9 z/ O% R; a& `: Y! Y/ {6 s-14       1.00000     host hdd-bigdata-compute01                           
3 v. L  a6 d  N4 W- G 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
5 |- a. j: s4 [# G, V4 J9 W% [' N. d-15       1.00000     host hdd-bigdata-compute02                           3 r9 b6 E( u& x
13   hdd 1.00000         osd.13                       up  1.00000 1.00000 1 d. n: w. Q5 j0 `# n/ J* k
-16             0     host hdd-bigdata-compute03                           ) _$ v& `! U( J  _* u- ^
-6       3.00000 root hdd-smalldata                                       . Q: v7 J/ d# Y' D: {6 C+ {, z* P
-17       1.00000     host hdd-smalldata-compute01                        
: Y3 \' z5 J( x1 q1 _  W4 F  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
3 S/ b" a# m0 |5 b6 z$ ^6 f- v-18       1.00000     host hdd-smalldata-compute02                        
( g' S7 S3 A( k3 F( ^1 @8 M% h4 d 10   hdd 1.00000         osd.10                       up  1.00000 1.00000
. H; y: R2 S: A-19       1.00000     host hdd-smalldata-compute03                         * W9 W7 Q$ K) Q( `
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 5 w2 c0 F1 M2 v3 C
-5       3.00000 root ssd-smalldata                                       
) p% _3 J" [! B-11       1.00000     host ssd-smalldata-compute01                         " A: n! V/ i* V
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 4 P7 _( m4 n1 Z4 ]6 k
-12       1.00000     host ssd-smalldata-compute02                         6 n7 j9 e3 ~" g% Q. X
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 ; A0 F) I4 w1 I. D7 }* h/ P
-13       1.00000     host ssd-smalldata-compute03                        
8 N( x0 ?/ L6 U6 v0 E  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
& F7 O: Q" y/ n. ]; ?3 l0 M3 x -4       6.00000 root ssd                                                 9 `  [, y0 L, R' F9 o
-8       2.00000     host ssd-bigdata-compute01                           1 \. v5 H- z: A7 \# P4 S! U
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
0 M# T4 m8 g5 F7 x  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
  ~+ F3 G+ ^0 y& b- {: y -9       2.00000     host ssd-bigdata-compute02                           ! P/ P; y, k, e
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
. U/ D6 H5 j, t9 B3 k  i  3   ssd 1.00000         osd.3                        up  1.00000 1.00000
# z1 T8 D$ X+ {7 {/ f-10       2.00000     host ssd-bigdata-compute03                           . y( D2 i3 U! [; a  x' X+ |
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
- x) t6 l) ~) y  |4 q8 P$ r  5   ssd 1.00000         osd.5                        up  1.00000 1.00000 ( N- w7 ^5 _. m% y! i' ^4 Z
-1             0 root default                                             
# a0 l& F5 F) {0 C" x9 V' e, N7 N1 U
1 m, B; p! {" n& X# d

" W2 k& e  R8 o* L[root@compute01 ~]# ceph osd crush --help
* |" l3 m: Z' @: D$ H: i General usage: 5 V% I( [5 G# P0 R; q4 Y8 [9 Y
==============
" r& p5 l. U$ ?) B$ ?+ uusage: ceph [-h] [-c CEPHCONF] [-i INPUT_FILE] [-o OUTPUT_FILE]5 [( D3 Z% w. `: h
            [--setuser SETUSER] [--setgroup SETGROUP] [--id CLIENT_ID]% ~) d/ \9 P7 K0 m  n8 o0 i* U5 ~, U
            [--name CLIENT_NAME] [--cluster CLUSTER]+ Y2 V: O) A" T
            [--admin-daemon ADMIN_SOCKET] [-s] [-w] [--watch-debug]" U8 K2 o0 H; }' x
            [--watch-info] [--watch-sec] [--watch-warn] [--watch-error]
( k+ X: [% [$ a& Z& B& c) k# [            [--watch-channel {cluster,audit,*}] [--version] [--verbose]
( A) n* y' i/ b            [--concise] [-f {json,json-pretty,xml,xml-pretty,plain}]/ D' t) N8 i5 n: F- g& R: N, B% I$ b
            [--connect-timeout CLUSTER_TIMEOUT] [--block] [--period PERIOD], b2 \6 s! {7 f0 l: E& i! p
Ceph administration tool
  @3 [# w: t- |optional arguments:
! f: H: I4 z% _  -h, --help            request mon help) T7 Y1 P( ^! M: N
  -c CEPHCONF, --conf CEPHCONF! I% ~% B9 G% X2 n4 X2 J
                        ceph configuration file* s% l7 W0 d) Y) g5 p
  -i INPUT_FILE, --in-file INPUT_FILE3 f! g- g+ [" h, W+ V5 P
                        input file, or "-" for stdin5 [# d/ Y, J$ o6 L
  -o OUTPUT_FILE, --out-file OUTPUT_FILE. C0 e8 R; |$ X" ?$ J( |. s2 l+ H' |
                        output file, or "-" for stdout; W4 u6 C* a% ^% q# [
  --setuser SETUSER     set user file permission, x* g% T: ], z# z3 `
  --setgroup SETGROUP   set group file permission5 O5 j6 y' g9 c3 a1 g3 V/ e
  --id CLIENT_ID, --user CLIENT_ID; ~- g* m) \  \2 q/ v6 k7 W5 f
                        client id for authentication
7 w, S* W9 f; e  --name CLIENT_NAME, -n CLIENT_NAME
& Q5 s+ f/ i* m) w; q: d                        client name for authentication
) E# G3 t3 I$ `* m( I1 ^9 `  --cluster CLUSTER     cluster name. J; Q/ n6 ?4 H6 g
  --admin-daemon ADMIN_SOCKET0 V8 P6 z3 R# q, c( D1 W3 `) S  C
                        submit admin-socket commands ("help" for help
5 x9 N- ?$ D3 k, `  -s, --status          show cluster status& b4 F# r( F" P. A' @2 S! }
  -w, --watch           watch live cluster changes
+ e9 x; @6 o( \( o! V$ C, X+ F2 `  --watch-debug         watch debug events& w/ F! H8 L1 s# B! D/ w
  --watch-info          watch info events
4 f/ i/ d- u8 m6 K  --watch-sec           watch security events! W$ @' f% e/ u
  --watch-warn          watch warn events; a/ t9 v! B9 @& b% _$ t8 k3 a, \* N
  --watch-error         watch error events, `# i6 Z$ M* Q: x' ~
  --watch-channel {cluster,audit,*}
6 g' Q9 d; o, s( d: V# O/ r                        which log channel to follow when using -w/--watch. One! {5 m8 K+ s- H# Y
                        of ['cluster', 'audit', '*'], X8 R. Q0 T" C: m& e3 v2 f) x
  --version, -v         display version7 n7 |, v  e& B9 H! F% T
  --verbose             make verbose) `( B$ F& t; ^. [2 R
  --concise             make less verbose
5 `1 \7 J3 u2 z) E  -f {json,json-pretty,xml,xml-pretty,plain}, --format {json,json-pretty,xml,xml-pretty,plain}7 y8 r( y/ a* r1 p) e3 y
  --connect-timeout CLUSTER_TIMEOUT3 l' q5 H2 u; Q/ o( l! t) n0 I, ]
                        set a timeout for connecting to the cluster
6 v. T- Y' `6 H; Q5 @9 M$ P  --block               block until completion (scrub and deep-scrub only)0 H6 O$ ^5 ?5 F2 [+ K  X9 |6 }( ^
  --period PERIOD, -p PERIOD
. W4 H4 Q( ?6 q$ C. b" u5 Z7 A- S                        polling period, default 1.0 second (for polling
8 U' j1 z- n! T2 P1 L  m) b0 [: V                        commands only)
7 P5 O* q3 M; s$ U% i  a Local commands: 3 Z& ]/ w% L8 h) j
===============
. A" Q8 V1 [  ]2 N4 Dping <mon.id>           Send simple presence/life test to a mon
+ w% f# ]5 j0 _7 O: R( N. R- R( B                        <mon.id> may be 'mon.*' for all mons& h; B4 u) w. T3 z. v3 l$ O
daemon {type.id|path} <cmd>
/ |% t  C# M3 B                        Same as --admin-daemon, but auto-find admin socket! f0 t- G, j2 T1 E- b- O
daemonperf {type.id | path} [stat-pats] [priority] [<interval>] [<count>]
* I2 I7 s. q7 @* Q. C2 Z( v; W% `daemonperf {type.id | path} list|ls [stat-pats] [priority]
- E9 K+ H4 Q" T) ?                        Get selected perf stats from daemon/admin socket$ C; R$ S7 b% P2 l
                        Optional shell-glob comma-delim match string stat-pats
6 Z* g8 u5 |1 Y2 L( _3 ^                        Optional selection priority (can abbreviate name):, K& |9 j3 q! n$ }( |$ N/ k% ]; x
                         critical, interesting, useful, noninteresting, debug
. h4 J5 ^8 M- W2 v; s+ k                        List shows a table of all available stats. o0 [; P! ~6 Z6 I9 L
                        Run <count> times (default forever),! ?/ p8 `: \$ I
                         once per <interval> seconds (default 1)4 F. h( H( ^/ e, _
   
6 k& @2 h! w- R) d$ y2 ^& Q0 u Monitor commands: . R% N, G- A0 k% j  F7 P" f
=================: D3 [+ ?+ k8 M* R
osd crush add <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]              add or update crus* \9 s& P6 Y- f8 w
                                                                                   <args>
3 }9 [& P6 M; Y. g! Uosd crush add-bucket <name> <type> {<args> [<args>...]}                           add no-parent (pro! O& T4 Z) h, ?1 `
                                                                                   <args>, S% ^+ }9 B  B, u* ^# ~" ^
osd crush class create <class>                                                    create crush devic
- J. E- h6 @4 u  t# b; Uosd crush class ls                                                                list all crush dev
4 Z- p' [" S, S4 |# P3 o" G# xosd crush class ls-osd <class>                                                    list all osds belo
( o1 P9 u- f$ ~5 ~7 |0 kosd crush class rename <srcname> <dstname>                                        rename crush devic
) Y) K* |: o0 f- d3 s7 hosd crush class rm <class>                                                        remove crush devic: x' _' @2 }8 s
osd crush create-or-move <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]   create entry or mo
( O: |3 G2 X; w* e2 @! Josd crush dump                                                                    dump crush map8 H  b$ j+ C; Z- o0 F# H8 D! a
osd crush get-device-class <ids> [<ids>...]                                       get classes of spe
- p; R1 `! J9 X( Oosd crush get-tunable straw_calc_version                                          get crush tunable
0 q0 j6 @' M  w) y1 v6 F& Y" Tosd crush link <name> <args> [<args>...]                                          link existing entr
: d# G1 S& G: \  Z. y0 ?; q& n4 D! Posd crush ls <node>                                                               list items beneath
, O$ \+ q+ a% }. E2 Yosd crush move <name> <args> [<args>...]                                          move existing entr; ^, F/ S; M4 u. Z" V; P
osd crush rename-bucket <srcname> <dstname>                                       rename bucket <src
) X1 N0 T( E1 zosd crush reweight <name> <float[0.0-]>                                           change <name>'s we! z( a4 J% {* [7 g$ ^
osd crush reweight-all                                                            recalculate the we
* E9 v5 @  o; Y9 R) K+ A: z3 P, Posd crush reweight-subtree <name> <float[0.0-]>                                   change all leaf it+ C4 @% Z0 N% Z; \! O2 ^) n
osd crush rm <name> {<ancestor>}                                                  remove <name> from3 w) M0 e6 E, @& _* B5 ?
osd crush rm-device-class <ids> [<ids>...]                                        remove class of th( b% j; t5 r) h$ w
osd crush rule create-erasure <name> {<profile>}                                  create crush rule
: k* v; ?8 a( e: k! U                                                                                   default)
" O, P7 Z, i' P1 B* @( Losd crush rule create-replicated <name> <root> <type> {<class>}                   create crush rule ( ]+ U! V' ?; c' ^' I9 l
                                                                                   across buckets of: D3 H, ~, o2 b" Y( N. \# d
osd crush rule create-simple <name> <root> <type> {firstn|indep}                  create crush rule / C9 d% y0 ~6 F$ g
                                                                                   <type>, using a c
0 a0 ?* H6 D. s6 [6 q8 ]9 e                                                                                   erasure pools)( l) f, S& i5 t9 |/ k2 t
osd crush rule dump {<name>}                                                      dump crush rule <n* x! p: @9 K+ M/ x$ _0 ]7 C
osd crush rule ls                                                                 list crush rules2 p! h, w* ~: H  ]% |2 I
osd crush rule ls-by-class <class>                                                list all crush rul. v" H: A: k7 T8 {
osd crush rule rename <srcname> <dstname>                                         rename crush rule ( a- }, G/ q2 `( t
osd crush rule rm <name>                                                          remove crush rule * @' \! @! a) c! s
osd crush set <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]              update crushmap po* ~  |- N3 n" v6 T
osd crush set {<int>}                                                             set crush map from
$ m5 ^2 F( j" G9 Nosd crush set-all-straw-buckets-to-straw2                                         convert all CRUSH : `1 b7 [+ [/ q. W
osd crush set-device-class <class> <ids> [<ids>...]                               set the <class> of3 t* Y. H. K, x
osd crush set-tunable straw_calc_version <int>                                    set crush tunable
) [0 ], {" D0 t. N, wosd crush show-tunables                                                           show current crush: [+ b7 a) a6 {3 E6 O( i8 E
osd crush swap-bucket <source> <dest> {--yes-i-really-mean-it}                    swap existing buck
; j5 }+ v' C2 [6 d3 T6 K# [# Posd crush tree {--show-shadow}                                                    dump crush buckets, k6 `5 _( T% X: C
osd crush tunables legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default   set crush tunables
: z$ @4 O! a0 t: d9 g2 H4 mosd crush unlink <name> {<ancestor>}                                              unlink <name> from
, B+ }# i( e6 K& x$ fosd crush weight-set create <poolname> flat|positional                            create a weight-se
; V, d: d( S! J! p% Qosd crush weight-set create-compat                                                create a default b5 N9 M# X2 P+ j
osd crush weight-set dump                                                         dump crush weight 0 L5 [5 F. e' i! v3 _, a) ]5 J( B9 c
osd crush weight-set ls                                                           list crush weight
7 F6 Q! n  X0 x- b4 P: d" ?5 Xosd crush weight-set reweight <poolname> <item> <float[0.0-]> [<float[0.0-]>...]  set weight for an 3 o6 |0 N5 @% K/ o
osd crush weight-set reweight-compat <item> <float[0.0-]> [<float[0.0-]>...]      set weight for an
  ?9 E  ?/ ^7 C1 bosd crush weight-set rm <poolname>                                                remove the weight-
. H+ S& d# S5 t) hosd crush weight-set rm-compat                                                    remove the backwar* s7 Y& V. G% f  Q7 z
[root@compute01 ~]# ceph osd crush class ) |- m7 M# {# E& C: c
create  ls      ls-osd  rename  rm      1 q0 l0 o+ g! C1 c
[root@compute01 ~]# ceph osd crush class 5 ]( _; I' \3 V3 n
create  ls      ls-osd  rename  rm      / s* W, f( M# {. H
[root@compute01 ~]# ceph osd crush class ls
3 @$ w) k/ E; G- X3 @" y[
, T; O& g6 i, H5 p    "ssd",
* E3 ]) \& T) E1 r4 H6 u. d# M5 [    "hdd"* Z! m) m: Q5 _# D) ]8 V. E( r; t
]+ }% C0 v2 L6 e+ k9 v

3 O3 f# F; S( Z2 l[root@compute01 ~]# ceph osd crush rename-bucket
7 b4 y, o7 i, _" C8 J" I9 i, _                                       #rename bucket <srcname> to <dstname>  1 }) y# F! {, |' ?3 G

6 w0 F$ R6 s$ S. ^# l1 Z[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute01 ssd-compute01$ M: [( u2 p3 m# H9 k9 b+ w
renamed bucket ssd-bigdata-compute01 into ssd-compute01
# i  c$ H3 T. A& x6 T3 x( ?: p( ][root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute02 ssd-compute02
* x! e+ h' o1 a2 }  g! trenamed bucket ssd-bigdata-compute02 into ssd-compute020 q7 b5 s6 U( m' I% d/ ]; c4 G6 {
[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute03 ssd-compute03% u! p( |8 p& ?% C
renamed bucket ssd-bigdata-compute03 into ssd-compute03
1 B7 Q. b7 ~6 I8 W
' u$ {# E) c4 J0 a8 Y  _[root@compute01 ~]# ceph osd tree' s5 o! p! ~3 i4 p
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF / s/ F) D$ |! g4 A+ p& f& d3 T
-7       2.00000 root hdd-bigdata                                         $ b. z( y- c0 ]
-14       1.00000     host hdd-bigdata-compute01                           
% _; g8 ^2 g% k  i8 } 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
  C8 l& b% _) B% y3 r( B  D-15       1.00000     host hdd-bigdata-compute02                           8 P: P2 W* E, X& n  R4 [( l
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
/ S+ E, }+ W: e8 f6 {1 F, A6 _5 r-16             0     host hdd-bigdata-compute03                           
' J+ f+ R$ f# R: m -6       3.00000 root hdd-smalldata                                       
- J( Z5 s, u% |9 H  B) `: f-17       1.00000     host hdd-smalldata-compute01                         ' z8 S* _# j+ f) N! ]
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
( `: Y6 z8 F  r-18       1.00000     host hdd-smalldata-compute02                         1 j) D* M# Z! ]7 _4 B! L
10   hdd 1.00000         osd.10                       up  1.00000 1.00000
( K, N7 y+ Z: F3 F-19       1.00000     host hdd-smalldata-compute03                         7 ^8 ?  L) O# ~  E( \3 p4 f: F# w
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 " a% \! S, m. W6 e* `' I
-5       3.00000 root ssd-smalldata                                       
/ t4 I% i3 V; T1 N4 J/ P-11       1.00000     host ssd-smalldata-compute01                        
5 a/ W" y5 e$ g" ]0 X# t7 w  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 5 v$ w. J. \2 H" q5 B8 l' X
-12       1.00000     host ssd-smalldata-compute02                         . y% n$ r- a6 O, k; X+ ^
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 # V* r, z* L- G
-13       1.00000     host ssd-smalldata-compute03                        
. o6 P2 _0 q6 a! [9 b7 U  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 0 C( |, k  Y/ T2 _
-4       6.00000 root ssd                                                
. @8 ~; ~8 V- n1 v8 O3 B -8       2.00000     host ssd-compute01                                   ! o' s( a7 M0 X1 ]
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000 ; N' e, x. |6 K& C4 i8 L4 N
  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
, o2 I1 `4 l+ ^2 M: G! y, P& x -9       2.00000     host ssd-compute02                                   , z4 k! e3 d1 ~3 Q% U+ Q
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 7 M  Y! D, w+ m) z' b- S& R* k0 i! Z
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 1 ]# {- O; @: }
-10       2.00000     host ssd-compute03                                   
( A3 _  R8 s% ~! ]. O* [5 S  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
, `) z+ c: Q% c: H9 L0 r6 ^  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
% _9 w9 A9 z) @1 R. f -1             0 root default                                             
# b6 y8 C. X9 D4 c; O[root@compute01 ~]# ceph osd crush rename-bucket ssd-smalldata-compute01 ssd-compute01
; ]: G+ f+ J" G0 AError EEXIST: dstname = 'ssd-compute01' already exists8 _( |6 F1 i* I
[root@compute01 ~]# ceph osd tree
. r' b0 ~& k: u1 ?8 GID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF . _: k7 [6 y0 G3 M
-7       2.00000 root hdd-bigdata                                         6 L: V3 A% l7 B. E, f4 u4 z
-14       1.00000     host hdd-bigdata-compute01                           
5 K" S* H% n' y; }( \# S+ s 12   hdd 1.00000         osd.12                       up  1.00000 1.00000 4 k$ y; R4 a" l2 L! v5 H9 n3 r9 J' F; x
-15       1.00000     host hdd-bigdata-compute02                           
% w+ J0 I% D' E0 M8 N2 D 13   hdd 1.00000         osd.13                       up  1.00000 1.00000
8 _; U& f0 K. r- h& T. m-16             0     host hdd-bigdata-compute03                           $ O0 s0 F+ L* b$ w2 ], e, T) p
-6       3.00000 root hdd-smalldata                                       2 T$ d# g  z) z
-17       1.00000     host hdd-smalldata-compute01                         1 P0 g" S" z2 p+ O% p- R" k
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
2 r- |! |* `7 q$ m! @9 B& H-18       1.00000     host hdd-smalldata-compute02                         ! p( ^2 v( Q# |' I) D
10   hdd 1.00000         osd.10                       up  1.00000 1.00000
! n6 R8 P5 L6 h7 h% T# T$ i3 {# z-19       1.00000     host hdd-smalldata-compute03                         4 k7 f8 l8 c9 F6 Q$ _
11   hdd 1.00000         osd.11                       up  1.00000 1.00000
( {3 L* h4 O, u6 V4 O: p+ n+ J -5       3.00000 root ssd-smalldata                                       
8 S) n3 f, {- v9 w4 N- l% j3 R* V. N-11       1.00000     host ssd-smalldata-compute01                         % F) T8 x! X1 Q% U! y" I
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 / U' k$ S; x) L. H2 ^. X, }; d
-12       1.00000     host ssd-smalldata-compute02                         4 ]" {6 }8 E* W0 f
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 8 Y% X' |6 j8 c- ?2 r2 c
-13       1.00000     host ssd-smalldata-compute03                         $ w8 |% V5 C0 O
  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 ' Q& J- K9 F0 y  m0 \3 L/ B& E9 h
-4       6.00000 root ssd                                                
' T$ f" B+ A6 Q) A: X& c$ A( M; y -8       2.00000     host ssd-compute01                                   
4 l- P$ p( M6 k% o! G  0   ssd 1.00000         osd.0                        up  1.00000 1.00000 8 E6 Y9 q8 S4 Z# t% C/ y/ G
  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
) q4 d1 k, ~: C -9       2.00000     host ssd-compute02                                   
: |; w) Z; x3 f1 \" p( ?$ f  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 ! O4 Y4 U# r; n5 ^# w
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 , G0 t. j( A$ d$ N# }& y* l
-10       2.00000     host ssd-compute03                                   
& Z" D$ l* Q  a% l; K7 e9 F  4   ssd 1.00000         osd.4                        up  1.00000 1.00000 - L/ M" C3 E7 p& R
  5   ssd 1.00000         osd.5                        up  1.00000 1.00000 # H! ?( n/ N+ m
-1             0 root default                                             + i  _6 E1 d; {; o6 ]0 B" s- f1 r3 Z) R
[root@compute01 ~]# ceph osd crush
8 p" V! d0 a- R! Y% badd                              remove                           set-device-class* e& \, f  d# T2 z" g
add-bucket                       rename-bucket                    set-tunable6 A4 j) M1 k$ V; Z  Q
class                            reweight                         show-tunables
5 `, z% k# O9 l. w& C6 h0 x! pcreate-or-move                   reweight-all                     swap-bucket
8 W( q0 J( I( t2 e  Bdump                             reweight-subtree                 tree8 n, C! s* _2 x7 Q9 R8 \; a
get-device-class                 rm                               tunables
+ I" R+ p9 p+ B' |2 _; v' s* yget-tunable                      rm-device-class                  unlink
1 c% N' r; D, X9 R: ^6 T  Clink                             rule                             weight-set5 o7 r: o1 R# ^. @- S
ls                               set                              " y8 v8 u+ ]! S2 z
move                             set-all-straw-buckets-to-straw2  
0 }* o0 x9 C  Q: N6 Y[root@compute01 ~]# ceph osd crush  set osd.6 1.00000 host=ssd-compute01, ^: B( @! v* Y8 ^3 S# Y
set item id 6 name 'osd.6' weight 1 at location {host=ssd-compute01} to crush map
# N8 S: r" d8 }[root@compute01 ~]# ceph osd crush  set osd.7 1.00000 host=ssd-compute02
( d1 [$ s, u8 b: ^set item id 7 name 'osd.7' weight 1 at location {host=ssd-compute02} to crush map3 J" \1 v: f& B( f& ~# s( B3 q
[root@compute01 ~]# ceph osd crush  set osd.8 1.00000 host=ssd-compute03
8 @8 r+ ^- D. ~$ n6 Y+ A9 Dset item id 8 name 'osd.8' weight 1 at location {host=ssd-compute03} to crush map
) N# D! j9 t: t5 P% O& X1 q9 \[root@compute01 ~]# ceph osd tree
1 e/ i: D8 c( @/ E4 v/ kID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
' f5 c* [, L2 N( D -7       2.00000 root hdd-bigdata                                         
  L; T+ d9 J9 i0 Q& H2 h-14       1.00000     host hdd-bigdata-compute01                           
" _& B0 C0 z1 e" o# ]5 p) j- a 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
- P: F! F. j2 E  a-15       1.00000     host hdd-bigdata-compute02                           9 k5 K# b1 F" g
13   hdd 1.00000         osd.13                       up  1.00000 1.00000 + C0 _1 q! R9 j" l3 G0 }0 Q, C5 q& x$ E
-16             0     host hdd-bigdata-compute03                           ! Z& {( {! }. J3 V; K0 P" [/ P2 m
-6       3.00000 root hdd-smalldata                                       2 i% |8 z  L% }7 D; b
-17       1.00000     host hdd-smalldata-compute01                        
( T. o9 h! {/ G7 Q  9   hdd 1.00000         osd.9                        up  1.00000 1.00000
3 C8 R+ a0 ]$ y" r1 O& ?, Y/ [-18       1.00000     host hdd-smalldata-compute02                        
- |: T: z$ b# b7 S' T( R, u9 H 10   hdd 1.00000         osd.10                       up  1.00000 1.00000
+ v. p* i$ N) h" x- ^$ a; b-19       1.00000     host hdd-smalldata-compute03                         ' ?) Z7 Q, s/ Z+ ?* x- b7 Y: N
11   hdd 1.00000         osd.11                       up  1.00000 1.00000
/ N  S8 i" U( U0 d5 G -5             0 root ssd-smalldata                                       
% z4 C3 l5 W% I0 N5 g" N" r-11             0     host ssd-smalldata-compute01                         4 }1 E8 k( U5 I# p7 p2 D7 t* f$ y
-12             0     host ssd-smalldata-compute02                        
& \7 t' p0 [  }+ W, W" n$ I! S0 q/ y0 Q-13             0     host ssd-smalldata-compute03                         / }/ `* {0 b' b4 c
-4       9.00000 root ssd                                                
+ g+ {' p% D( V& U -8       3.00000     host ssd-compute01                                   
0 ]- h9 h. u% x  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
: l$ \6 m1 W9 G8 E# r6 v4 B  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 . b) ?8 r, d$ N9 q0 ^, A
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000
, [8 S- B( Z# |* B+ P( e# a: x -9       3.00000     host ssd-compute02                                   1 K3 q, I2 `6 M; Q, h
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 7 S& y5 e% [7 A9 V/ s. j
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 ( s- a1 m. G: N$ M, X! W. d
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 9 P# v1 ]$ B5 l- T; ]
-10       3.00000     host ssd-compute03                                   3 ^7 L/ f: `% ?# N
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000 + H/ {( ^0 T4 a, t; @( Q% V: {* m8 ?7 f0 z
  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
1 [5 t* I- P1 U! \! ]  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 ; y+ _! {% @2 x) @/ ~+ o
-1             0 root default                                             
/ e9 z3 t7 Z2 \! ^& C# q$ D[root@compute01 ~]# df -TH3 F: k% V8 d- N: q5 l8 \# v
Filesystem              Type      Size  Used Avail Use% Mounted on7 b% c/ _0 C, c
devtmpfs                devtmpfs   68G     0   68G   0% /dev3 p# f  C: S) ?/ p& A
tmpfs                   tmpfs      68G     0   68G   0% /dev/shm
2 M) e$ t* R$ O/ ~; w' g, ltmpfs                   tmpfs      68G  9.8M   68G   1% /run
4 G5 j4 M9 S2 I. o1 p0 `tmpfs                   tmpfs      68G     0   68G   0% /sys/fs/cgroup
: d2 t: ~) X6 k, y7 d* b/dev/mapper/centos-root xfs       582G  2.8G  579G   1% /
* Y: o; a1 @6 _$ @/dev/sda1               xfs       1.1G  158M  907M  15% /boot
6 l  @1 |' |' s1 R4 f. h7 Ftmpfs                   tmpfs      14G     0   14G   0% /run/user/0
4 J- N$ x* x' [7 o2 ~# ^tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-0( A, \1 Z% W# P4 H7 Y4 m
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-1( ?: W/ ]5 `! R6 `
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-61 m$ v  Y! z: ]! N
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-9
5 N. R& X! W0 Qtmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-12
" L. K" [1 K2 H' O7 n5 W[root@compute01 ~]# 0 F! |; N3 e; f( ~( Y
[root@compute01 ~]#
2 d; J5 }/ D5 a, m- Q+ D[root@compute01 ~]# " f5 a7 N4 H7 z  \& c
[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute02   m2 o$ j5 g! c% e8 f  {" M8 T
removed item id -12 name 'ssd-smalldata-compute02' from crush map
0 F( _& i: r2 m% w6 M* }[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute01 ) ^! e6 }& K% u0 \7 Y' `
removed item id -11 name 'ssd-smalldata-compute01' from crush map# Q$ K3 F: n$ f: e/ F
[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute03
# \6 m1 g) P2 ]/ hremoved item id -13 name 'ssd-smalldata-compute03' from crush map
5 R& k; q' K4 N( [[root@compute01 ~]# ceph osd crush remove ssd-smalldata% ]8 z2 y& _2 E) A
Error EBUSY: (16) Device or resource busy# X1 x8 S( l3 a- r8 j/ j( O7 v
[root@compute01 ~]# ceph osd tree
8 C: h4 C& |- g' @3 X6 fID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
# Q8 Z+ {: U! X -7       2.00000 root hdd-bigdata                                         
, h9 ~: @  C# d# y' g6 T1 v-14       1.00000     host hdd-bigdata-compute01                           
! U# m( I. }: X: s2 g2 U 12   hdd 1.00000         osd.12                       up  1.00000 1.00000 ' o% Q5 |& u- `
-15       1.00000     host hdd-bigdata-compute02                           
+ A' E- G1 c) z; z% |! y) c6 c% U 13   hdd 1.00000         osd.13                       up  1.00000 1.00000 4 J" @; y1 P6 |6 B
-16             0     host hdd-bigdata-compute03                           
# I0 I* T  J# Q' L0 } -6       3.00000 root hdd-smalldata                                       - g  |3 C9 R+ h# v% `
-17       1.00000     host hdd-smalldata-compute01                         : Q* ?% H3 \  I2 A' E/ I
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 1 N0 c% z8 h# b% ~
-18       1.00000     host hdd-smalldata-compute02                        
. M5 f6 N# Q, S" c 10   hdd 1.00000         osd.10                       up  1.00000 1.00000 ( U  c( \3 G6 T$ H2 t; D& H
-19       1.00000     host hdd-smalldata-compute03                         % g, I6 x. I5 C
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 1 [' v& |2 _- a1 J+ X- v' b' Q3 t
-5             0 root ssd-smalldata                                       
2 J2 ?9 z% h1 _0 K& ?; i -4       9.00000 root ssd                                                 & d, V  m+ `: B8 k6 {
-8       3.00000     host ssd-compute01                                   
" K  G2 I6 {( M) d9 ~& d, H  P: {  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
# h% J. O' t" @6 d/ [  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 + A) q! Y7 {5 T5 O  h" ?; u( ?8 m* V
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000
1 S9 I* |# r3 O) L2 J. p -9       3.00000     host ssd-compute02                                   
6 J& _' y( Q, [# W% n  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 ' R1 l) H! c: d9 t
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 * f( b! j" Y, q
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
8 x: C; [3 \$ h/ l8 D# `-10       3.00000     host ssd-compute03                                   8 G% D; Q5 e/ B( \) ^+ }$ \
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
7 g; y4 Y5 @& Y) ~& |; I  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
4 T0 Z+ ^/ ^+ k, _( E9 |  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
# E3 I* @) F& S) L -1             0 root default                                             % y  B/ N& e( C. D
[root@compute01 ~]#   r2 u# b% J3 E1 ~3 v. a
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

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

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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