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

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

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2022-4-7 09:32:13 | 显示全部楼层 |阅读模式
[root@compute01 ~]# ceph osd tree
, o) K* t0 D6 u* P. q6 aID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
9 a* E5 v& X2 Y2 B2 [# g -7       2.00000 root hdd-bigdata                                         
" s2 Y5 ^- U) f-14       1.00000     host hdd-bigdata-compute01                           % n. o! w+ V* q  x. r% H9 i# P: l
12   hdd 1.00000         osd.12                       up  1.00000 1.00000
% O0 {3 C3 W, \0 k: V; @1 e3 w- D' k3 D-15       1.00000     host hdd-bigdata-compute02                           
, B9 }: i. N0 s) }5 J+ U: \ 13   hdd 1.00000         osd.13                       up  1.00000 1.00000
& u6 r# m$ r; E" K-16             0     host hdd-bigdata-compute03                           9 C) @4 {# e8 l; h
-6       3.00000 root hdd-smalldata                                       
. x( G9 z- ?+ n- r- Q' s, c$ `+ N5 {4 N-17       1.00000     host hdd-smalldata-compute01                         / u3 p5 M  T& u: J# {6 a
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 ) t9 @7 J+ u  f  ~7 {
-18       1.00000     host hdd-smalldata-compute02                        
1 ~9 X5 R$ ~8 m# j 10   hdd 1.00000         osd.10                       up  1.00000 1.00000 # O) q; H, t& E: a' T
-19       1.00000     host hdd-smalldata-compute03                         ! S, H, T' p3 `& B9 v
11   hdd 1.00000         osd.11                       up  1.00000 1.00000
6 k! n# n: w- [2 E -5       3.00000 root ssd-smalldata                                       
6 N" m) R; M- @9 w0 _( T# K-11       1.00000     host ssd-smalldata-compute01                        
, ^; L: ~* f- X* I  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 / k2 d& p' e* F& p  o
-12       1.00000     host ssd-smalldata-compute02                        
; e! ]1 t$ i6 y( q- ~; }# S% c6 D  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
7 I  S# Z' K* j0 m, u6 y& ~-13       1.00000     host ssd-smalldata-compute03                        
' N' p1 _/ ?6 A2 F( v  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 6 G' K! ?1 W+ o/ h/ P
-4       6.00000 root ssd-bigdata                                         
' s' |* ?4 R) L. V! S% p -8       2.00000     host ssd-bigdata-compute01                             W: Q4 q; E+ ~$ h; V! O, ^3 s4 V
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000 ' k8 U! F) u, A/ @& Q0 a9 z' P
  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
4 `$ C" _; W- L! x -9       2.00000     host ssd-bigdata-compute02                           / i& |+ [4 j. A- s) W# l* Y
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
0 Y2 J4 I' {1 H. a, w  3   ssd 1.00000         osd.3                        up  1.00000 1.00000
- l+ D5 C! P% Q, K-10       2.00000     host ssd-bigdata-compute03                           ' f3 x9 b  k- j- O
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
" I$ S- d' t3 U& w6 O- v  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
& Z7 ~, W- s% j! w  n  D -1             0 root default                                             
8 |& _* k$ ]( I$ n8 z7 _. w  k5 X7 z9 n# y  }5 L  d' U. M
$ K" m6 A5 j  l3 B  \" L

) R$ Y6 P8 d) P: O0 k) B2 A% u[root@compute01 ~]# ceph osd  crush rename-bucket ssd-bigdata ssd
' D/ O9 x3 r7 Frenamed bucket ssd-bigdata into ssd: f% O8 T/ B& |) \: ]% f
[root@compute01 ~]# ceph -s. O/ U* h, P! ~6 ]
  cluster:; T% g$ O8 I8 h
    id:     2af51d38-db90-4a57-a43d-ea9f6ebd7482* e" D8 h5 p) ~# [! y& d
    health: HEALTH_OK
  Z  [: h( e- u9 P 2 o; i8 C# ]% j& s
  services:
7 n  g& s) v3 _3 `: G    mon: 3 daemons, quorum compute01,compute02,compute03 (age 17h)7 d& u' S' g5 @# Y
    mgr: compute01(active, since 17h), standbys: compute02, compute03
4 a- q/ d0 ]; q& o    osd: 14 osds: 14 up (since 16h), 14 in (since 16h)
& @! A. B# y- C
- h* S( G  W, Q% i/ k& W  data:' |8 t" A+ e1 w0 H0 I- s
    pools:   0 pools, 0 pgs- i* y4 F' i& [6 N: s& ~1 e/ R
    objects: 0 objects, 0 B) E0 S& t$ ~: h; I  P4 ?
    usage:   14 GiB used, 13 TiB / 13 TiB avail
' K6 E5 v; }: d    pgs:     
) z! G! |0 \) H' s- O: n 3 h5 s1 z  ~* c' b9 y
[root@compute01 ~]# ceph osd tree. r) ]4 p: r. G1 m; K) _. G& r3 u
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF $ O, i- {" K( [5 m. k
-7       2.00000 root hdd-bigdata                                         
- p& H* K6 F" X' n& N2 c, i( L-14       1.00000     host hdd-bigdata-compute01                           / i& |# F" C% y3 ~: P! k
12   hdd 1.00000         osd.12                       up  1.00000 1.00000 & x8 N6 M* ?8 x+ Z0 w1 k
-15       1.00000     host hdd-bigdata-compute02                           9 I4 v6 b. X. H4 D3 h! m8 Z  H) A
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
8 T5 Z; P/ C' B  Z-16             0     host hdd-bigdata-compute03                           
  ]& T% D; x  l: W4 U6 R% t* e' i -6       3.00000 root hdd-smalldata                                       
: ]1 |) ^. Y. e3 l6 s8 E) H-17       1.00000     host hdd-smalldata-compute01                        
% @6 @; O: o- }, ?. i2 E; O  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 * ?" n' Q5 m+ c1 W
-18       1.00000     host hdd-smalldata-compute02                        
! g7 B& Q0 F  J( { 10   hdd 1.00000         osd.10                       up  1.00000 1.00000
6 i7 b- q6 j1 }-19       1.00000     host hdd-smalldata-compute03                        
* y- J. Z0 w/ O 11   hdd 1.00000         osd.11                       up  1.00000 1.00000 0 B. v" t- B6 s2 I8 M
-5       3.00000 root ssd-smalldata                                       9 V' z6 r6 l5 Y# e- m
-11       1.00000     host ssd-smalldata-compute01                         8 I+ o5 P  g7 A- n' ]  R
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 - Z( ?1 q. E+ P; B
-12       1.00000     host ssd-smalldata-compute02                        
% }. }8 `7 Y" ?6 f  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 # _# n# T: E- m3 y
-13       1.00000     host ssd-smalldata-compute03                        
0 b0 b; C( T7 A) h$ Z' ^  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
; u3 _; ?, a5 A. y, v -4       6.00000 root ssd                                                 2 C( P( G; I6 y  [
-8       2.00000     host ssd-bigdata-compute01                           
" g2 I' Q- N+ N  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
6 ?/ U0 y* |" J: v6 H& [' D( k. e% P  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
0 [8 n( _9 H2 x+ i* B -9       2.00000     host ssd-bigdata-compute02                           ) T) o) }2 E/ c- G4 ]& o( S
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000
( y' @, e! O% z* S/ o  3   ssd 1.00000         osd.3                        up  1.00000 1.00000
- @+ S, @2 J* K+ _-10       2.00000     host ssd-bigdata-compute03                           3 ?9 l+ |3 @$ Q1 U  M
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
# j/ ~0 P" j2 [: R  5   ssd 1.00000         osd.5                        up  1.00000 1.00000 3 L2 t& h: K" q/ [" x9 Q  S! d! P
-1             0 root default                                             
: Z$ V. r1 a) g9 c7 X+ u2 `  Y: Z5 R" Y* O# |
* F) p( ?9 Q( j% c4 ~
+ `( K  `* u3 Y! ~9 m  Q
[root@compute01 ~]# ceph osd crush --help
% h- V# t3 M- N" l: ~ General usage: - ^7 Y1 h% |, w+ ?
==============2 T/ m% [2 H' n! u7 e
usage: ceph [-h] [-c CEPHCONF] [-i INPUT_FILE] [-o OUTPUT_FILE]  Y7 K6 D6 H; l) A6 N
            [--setuser SETUSER] [--setgroup SETGROUP] [--id CLIENT_ID]
( z0 T& ~; A: ?# F; q) d            [--name CLIENT_NAME] [--cluster CLUSTER]. \; d( `7 d6 l# c
            [--admin-daemon ADMIN_SOCKET] [-s] [-w] [--watch-debug]6 q3 W2 R! o* j/ H5 g5 P3 W7 S5 a
            [--watch-info] [--watch-sec] [--watch-warn] [--watch-error]
" A4 B  }( ~$ V8 ?& q8 R            [--watch-channel {cluster,audit,*}] [--version] [--verbose]
! a" ]0 Y; b% ]2 Z6 y- k4 F            [--concise] [-f {json,json-pretty,xml,xml-pretty,plain}]
0 u5 E4 g, H* R) O" L2 k            [--connect-timeout CLUSTER_TIMEOUT] [--block] [--period PERIOD]
& ^( C, G( l! V% VCeph administration tool
2 Q9 ?0 i. T6 k5 }8 {# P$ B4 Soptional arguments:% [( f4 q- [- Y, @! C  h" J; m  F, ]
  -h, --help            request mon help
3 }2 Z2 P6 R1 ~% B" Y* g  -c CEPHCONF, --conf CEPHCONF
* z( }' f( S7 U8 O+ I8 V- r                        ceph configuration file0 k" F3 F' [* I% ]9 ]' Z  M' u
  -i INPUT_FILE, --in-file INPUT_FILE3 {; `8 L) B7 h! h- ^
                        input file, or "-" for stdin& J8 X5 O# E/ h$ B. F! ]; T
  -o OUTPUT_FILE, --out-file OUTPUT_FILE! x% [1 T  w* L. h* w, V6 k0 z
                        output file, or "-" for stdout
3 m4 U, K4 p1 R) ?: n  --setuser SETUSER     set user file permission
9 m  z/ z7 l5 t( @4 s# ]  --setgroup SETGROUP   set group file permission5 i& m3 b! w9 N* }6 r% x$ K+ ^
  --id CLIENT_ID, --user CLIENT_ID
2 V) ?* ?" z2 r, y7 ]) w* n                        client id for authentication: B. V9 |4 F; j6 H0 W9 }* o
  --name CLIENT_NAME, -n CLIENT_NAME2 a- [9 t4 X! P& E- R) d) N
                        client name for authentication$ s: i; N% n' J" X2 O
  --cluster CLUSTER     cluster name$ K  L  j- {5 K# h0 ~# ?
  --admin-daemon ADMIN_SOCKET( d9 W2 j9 G6 [" j; x: g6 k
                        submit admin-socket commands ("help" for help
" @4 `/ D; n( }  -s, --status          show cluster status4 Q, }: c% `# a" n" R# x! y
  -w, --watch           watch live cluster changes
* p( T- Z  J. Q6 n0 p; l  --watch-debug         watch debug events; m0 @. D/ l4 w+ [) F: g* w1 ^
  --watch-info          watch info events
5 m! v* {8 [' {  --watch-sec           watch security events
6 s9 x9 L, [$ }  --watch-warn          watch warn events
; V7 `( d( F5 m3 U  @5 j' H* e  --watch-error         watch error events( Q9 J1 Q1 @6 i) b0 V, N7 I
  --watch-channel {cluster,audit,*}
, M, Q. Y. g1 Q0 _( g& W                        which log channel to follow when using -w/--watch. One
0 Y$ Y( _6 f* O  y: j; A2 o                        of ['cluster', 'audit', '*']
/ v& D( u9 ]* V  --version, -v         display version
6 ?; r6 S+ k9 t4 x8 o1 ~, `3 h& h  --verbose             make verbose% k. s- |( M. i* v9 \0 s0 O" p7 Z
  --concise             make less verbose( v# }" V4 h8 p( M, ~" t
  -f {json,json-pretty,xml,xml-pretty,plain}, --format {json,json-pretty,xml,xml-pretty,plain}
+ o8 ?3 S2 g& H  --connect-timeout CLUSTER_TIMEOUT9 ]3 p- @9 s# \! a0 N8 e. h) I
                        set a timeout for connecting to the cluster
! h% Y  G: V9 v# V+ d  --block               block until completion (scrub and deep-scrub only)* [  d  p4 V7 \3 g5 C- r* D! P: J) L
  --period PERIOD, -p PERIOD
% `: v& y) s3 _2 G$ F9 S                        polling period, default 1.0 second (for polling
' m- Q6 M( a6 ]0 t; m                        commands only)
# `! T; p  Q& j0 h# x Local commands: ! r# Z& j0 E7 J8 e. |7 Y) _8 |# S
===============
) ^8 W/ G- K; S* V( A2 i2 R: Rping <mon.id>           Send simple presence/life test to a mon2 m/ P$ s( A3 \3 s5 |
                        <mon.id> may be 'mon.*' for all mons+ M: \7 \4 {1 N, T) K
daemon {type.id|path} <cmd>2 h* T3 V) o( L0 V/ g+ K8 o
                        Same as --admin-daemon, but auto-find admin socket
9 e# f$ C, U* B4 a; Cdaemonperf {type.id | path} [stat-pats] [priority] [<interval>] [<count>]. ]- b; j  P- N' r# G" s
daemonperf {type.id | path} list|ls [stat-pats] [priority]
% l" m7 q3 v1 Y5 e: g% N                        Get selected perf stats from daemon/admin socket. B$ t: N! x/ _0 u4 Q
                        Optional shell-glob comma-delim match string stat-pats
$ u7 Q7 Q! F% S, A' {# a. r4 j                        Optional selection priority (can abbreviate name):
# |9 j( F$ u% [7 Y: C/ }                         critical, interesting, useful, noninteresting, debug
9 N( s; b2 O/ T% k4 Q                        List shows a table of all available stats
6 t* l" X! g0 k) G+ P                        Run <count> times (default forever),6 I# Y* x5 Y# X* @' k( T& o
                         once per <interval> seconds (default 1)
( N9 z" P0 a4 K* w  J   
" x4 y. z+ {" i) V, y Monitor commands:
* b- D8 K4 e2 g1 i( Y =================
+ V3 Q+ U# ^- W+ N1 Rosd crush add <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]              add or update crus$ f1 ~3 z; Y1 H
                                                                                   <args>& x: _' N" C* a
osd crush add-bucket <name> <type> {<args> [<args>...]}                           add no-parent (pro
3 j9 x/ I, v* `- U+ T+ Q                                                                                   <args>
: v2 v; M$ \+ z4 Josd crush class create <class>                                                    create crush devic
5 i* X# ]8 y9 x: oosd crush class ls                                                                list all crush dev
5 v' Q1 r( j2 {+ P1 Xosd crush class ls-osd <class>                                                    list all osds belo
" T8 W  Z. m7 m, [% o0 @osd crush class rename <srcname> <dstname>                                        rename crush devic; v7 E# l& A- ^6 w5 u
osd crush class rm <class>                                                        remove crush devic( t( C9 V2 t, L
osd crush create-or-move <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]   create entry or mo
2 Y% P, u& u2 g: P1 Y  U6 fosd crush dump                                                                    dump crush map! V7 C" s8 f) ]( b
osd crush get-device-class <ids> [<ids>...]                                       get classes of spe
) v; c% f+ e0 Y/ ?! D6 wosd crush get-tunable straw_calc_version                                          get crush tunable 1 V% c" Q2 r0 G) V3 h# V
osd crush link <name> <args> [<args>...]                                          link existing entr0 z8 R+ r5 E: h+ d
osd crush ls <node>                                                               list items beneath8 V! H$ T: ]" I$ I8 j2 e
osd crush move <name> <args> [<args>...]                                          move existing entr
( M' I9 V) K2 L' W* P  Losd crush rename-bucket <srcname> <dstname>                                       rename bucket <src
' t6 `# u& @% w/ V5 L9 vosd crush reweight <name> <float[0.0-]>                                           change <name>'s we  B) U+ Q, }! @6 F
osd crush reweight-all                                                            recalculate the we3 n9 q' S9 N& S! |* e
osd crush reweight-subtree <name> <float[0.0-]>                                   change all leaf it# m; j  T! G9 ~/ H; y4 Q$ K
osd crush rm <name> {<ancestor>}                                                  remove <name> from" g( s8 N/ P& S: B( N: c. \8 V
osd crush rm-device-class <ids> [<ids>...]                                        remove class of th
1 `9 X  |) {6 o- y5 D5 ]+ vosd crush rule create-erasure <name> {<profile>}                                  create crush rule / N# i% l" h* L/ h( V0 b/ [8 S
                                                                                   default)- I0 Z) u6 t- K- A$ v
osd crush rule create-replicated <name> <root> <type> {<class>}                   create crush rule
4 I/ w: G& \9 k, r/ ]                                                                                   across buckets of# x! ]9 Z  o9 R! a
osd crush rule create-simple <name> <root> <type> {firstn|indep}                  create crush rule ) {6 B1 Z: y) B  l% v; s
                                                                                   <type>, using a c" X1 _" B2 g/ ]+ U1 A1 e  v7 e; y
                                                                                   erasure pools)
; d% E/ u; \. t$ w: ?8 i+ I9 aosd crush rule dump {<name>}                                                      dump crush rule <n
# A7 z' {8 i0 ?' a& v, c% w& Xosd crush rule ls                                                                 list crush rules4 o+ n7 q: {% }: b
osd crush rule ls-by-class <class>                                                list all crush rul
% i+ W1 O! }( ?: Zosd crush rule rename <srcname> <dstname>                                         rename crush rule
) w+ u1 j" a3 _6 aosd crush rule rm <name>                                                          remove crush rule
. D: p* K; K5 f  ^. @$ t; x6 a  @osd crush set <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]              update crushmap po
) ]- @( Q5 w, A% i' s5 losd crush set {<int>}                                                             set crush map from
3 }  j, S3 u+ ]4 J$ P3 josd crush set-all-straw-buckets-to-straw2                                         convert all CRUSH
5 {2 g, j4 @+ e! }; ^osd crush set-device-class <class> <ids> [<ids>...]                               set the <class> of2 T, E0 X$ J- \% b1 r2 y8 ^
osd crush set-tunable straw_calc_version <int>                                    set crush tunable 2 M: q+ X& B/ ^5 A/ q  T
osd crush show-tunables                                                           show current crush
: K& E+ ^/ \: m6 a' v& bosd crush swap-bucket <source> <dest> {--yes-i-really-mean-it}                    swap existing buck/ q( [* X0 w* e/ C& g! a
osd crush tree {--show-shadow}                                                    dump crush buckets
. s7 a5 H( X+ J. \1 Q( [osd crush tunables legacy|argonaut|bobtail|firefly|hammer|jewel|optimal|default   set crush tunables
6 D7 ^( f3 ^; _; josd crush unlink <name> {<ancestor>}                                              unlink <name> from* Y( V% @+ w% P& m
osd crush weight-set create <poolname> flat|positional                            create a weight-se
  Q0 p- c" ]  H! l, @osd crush weight-set create-compat                                                create a default b" N7 K+ O; p* I, U5 m7 R
osd crush weight-set dump                                                         dump crush weight # s+ U+ b5 p1 U$ M5 P0 C- E
osd crush weight-set ls                                                           list crush weight 5 ^# {. f; \7 m" G
osd crush weight-set reweight <poolname> <item> <float[0.0-]> [<float[0.0-]>...]  set weight for an - l5 j0 Z  q- J% H6 Y2 c* u& Z8 m1 a3 j
osd crush weight-set reweight-compat <item> <float[0.0-]> [<float[0.0-]>...]      set weight for an
# e( F  c- ]9 p2 _osd crush weight-set rm <poolname>                                                remove the weight-1 V6 y; g" a! t' w1 C0 O
osd crush weight-set rm-compat                                                    remove the backwar, |" O$ X3 Z; H6 ?) w" }+ U3 n. l
[root@compute01 ~]# ceph osd crush class & B# ]  r( H7 t# M2 X5 b% j1 r4 l
create  ls      ls-osd  rename  rm      
) N- ]0 C* |" F% D) C[root@compute01 ~]# ceph osd crush class
1 u& I" z9 A4 m9 Kcreate  ls      ls-osd  rename  rm      
% d2 O* x, c3 z: z1 J$ U$ H$ e- {[root@compute01 ~]# ceph osd crush class ls- D- A% {8 t3 i4 c( W4 k; f. a
[
1 T- O$ T$ R+ Q5 p    "ssd",8 A, X# k) f. f- @9 X! f
    "hdd"
% k2 Y5 w6 _4 b1 a$ M0 b9 l]
+ v/ Q% Z3 t# t5 X: b' I# s# ?# L% ^' ?
[root@compute01 ~]# ceph osd crush rename-bucket
! b/ s6 T/ I! B6 d                                       #rename bucket <srcname> to <dstname>  * m8 s; i3 [4 L% b5 @% C7 [/ z

/ O. O9 G" R& F$ T! s[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute01 ssd-compute015 g- i; X7 U1 L. o- P/ b  i( ?! ~
renamed bucket ssd-bigdata-compute01 into ssd-compute01
" n$ Y, M( T8 g& D, u+ s" q[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute02 ssd-compute02
# ]' q" e, g. }7 M. Y6 }renamed bucket ssd-bigdata-compute02 into ssd-compute02
5 i7 I/ k  V2 ^% ]' ^& A( f[root@compute01 ~]# ceph osd crush rename-bucket ssd-bigdata-compute03 ssd-compute03% R, `: U' {# [1 d3 E
renamed bucket ssd-bigdata-compute03 into ssd-compute03
. h& ]( `5 a( w9 U! z' j
9 F% `, ^* z% l& m[root@compute01 ~]# ceph osd tree9 @% L- p9 a4 u) w& j
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF
. g$ f1 [( S  x. u6 u3 n -7       2.00000 root hdd-bigdata                                         
- R% P' K9 g# s-14       1.00000     host hdd-bigdata-compute01                           
1 x7 c" [% H/ E 12   hdd 1.00000         osd.12                       up  1.00000 1.00000 % }! w. Q4 }+ B4 v- A: Y* v3 t: F! b
-15       1.00000     host hdd-bigdata-compute02                           3 `- T! f. I; b! s# A8 [: |
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
$ c, N. A7 g- g5 o-16             0     host hdd-bigdata-compute03                           
3 a2 j! |0 t' c" R* v% r -6       3.00000 root hdd-smalldata                                       " E( d' O6 F4 D: t2 D$ b3 v/ r
-17       1.00000     host hdd-smalldata-compute01                         5 [3 ^- R8 {8 e+ `: \6 Z: o4 B
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 4 @- [* I4 @6 w1 ~0 w
-18       1.00000     host hdd-smalldata-compute02                         ! A6 M( d" d7 w" s! @
10   hdd 1.00000         osd.10                       up  1.00000 1.00000
% K' n- W, Y& W2 p$ A/ Z, h-19       1.00000     host hdd-smalldata-compute03                        
# `) W3 S: l% b; c2 V( p 11   hdd 1.00000         osd.11                       up  1.00000 1.00000
% S6 c& z- j3 c9 ]0 U -5       3.00000 root ssd-smalldata                                       
; f) u0 L% H# z* \1 j$ B0 \: H-11       1.00000     host ssd-smalldata-compute01                        
# v& ~! t8 k8 K: R+ u6 C  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 " @$ n, R. p' N- c/ A$ |: ]
-12       1.00000     host ssd-smalldata-compute02                        
5 k* J+ ?( h. k+ u# @  7   ssd 1.00000         osd.7                        up  1.00000 1.00000
6 Y0 x- _; h4 v* Q; N, G- e-13       1.00000     host ssd-smalldata-compute03                        
2 D) ^9 A5 }/ A  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 ! S9 ^9 `  K- p9 A* h2 p
-4       6.00000 root ssd                                                 8 ~2 I4 T5 A; n5 ]( l, ]+ _% _  C
-8       2.00000     host ssd-compute01                                   
8 L. k2 b, _$ \3 o% k' B. M  [  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
) U& n; J6 c8 H. \  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
" p7 O: |$ C0 }# n -9       2.00000     host ssd-compute02                                   
+ s3 A5 |1 {- b+ E/ |3 O2 A. V  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 9 v5 p4 a; T: C
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000   E# T& i8 c1 N4 _4 j8 u1 v
-10       2.00000     host ssd-compute03                                   0 R% V" O$ a; i* _. \
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000 * h/ S6 `7 U. m' |: u, O$ v
  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
8 v( R; i  z( E  y -1             0 root default                                             ' n, v. J+ f8 }
[root@compute01 ~]# ceph osd crush rename-bucket ssd-smalldata-compute01 ssd-compute01
3 m( z) ]0 k5 Y7 c( w' fError EEXIST: dstname = 'ssd-compute01' already exists
) _" I; |, y0 I0 z9 J3 L[root@compute01 ~]# ceph osd tree- n) V4 F- u' Z! ^# j3 ]8 ~
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF ) n9 t3 ^6 v$ T3 o* N
-7       2.00000 root hdd-bigdata                                           X8 [; Y6 o3 a( |% r6 h" y
-14       1.00000     host hdd-bigdata-compute01                           
6 s$ V, g# ^6 G7 T- {$ r3 U8 |1 O& i 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
* A/ _- j" t/ z! Z-15       1.00000     host hdd-bigdata-compute02                           ' L" C: P) O, C' c' }
13   hdd 1.00000         osd.13                       up  1.00000 1.00000
% }9 j& O8 w5 M$ `-16             0     host hdd-bigdata-compute03                           $ c4 i, d" T5 d9 `6 B5 p" V+ ?
-6       3.00000 root hdd-smalldata                                       
2 K7 g7 ~& [. @-17       1.00000     host hdd-smalldata-compute01                         7 c2 p8 K& I  K- a) Z
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 ( u. J( q7 k! ], v: D
-18       1.00000     host hdd-smalldata-compute02                         " |5 c2 ^- S! R! U+ D* a" ?$ H
10   hdd 1.00000         osd.10                       up  1.00000 1.00000 * ^5 c* R3 U4 t! t" m/ \
-19       1.00000     host hdd-smalldata-compute03                         ' c; t0 G5 I8 H3 C: F% j1 b0 A* l
11   hdd 1.00000         osd.11                       up  1.00000 1.00000 6 s, m- k* }5 T. Z* z
-5       3.00000 root ssd-smalldata                                       
* e. w. c) Z" `: e1 l6 s-11       1.00000     host ssd-smalldata-compute01                         ' E% _5 `( ]+ i% w4 w
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000
0 `# ^; e4 V1 a' |0 l9 _-12       1.00000     host ssd-smalldata-compute02                         , J) N- |7 t! @4 n# f
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 ) Z+ K& h0 Y0 z8 S# y9 d4 p
-13       1.00000     host ssd-smalldata-compute03                         5 y# i  ?" Q) S, j- z
  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
( c$ C, R- W, ]0 {! A- n6 p+ Z -4       6.00000 root ssd                                                
. e; P, f2 W1 X9 ?. \; ` -8       2.00000     host ssd-compute01                                   9 r- F* f* U3 a8 b* f4 s3 B
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
5 v9 ~) d% g* Z4 P4 i# K2 o  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 1 ]+ h5 H# [+ s9 t: |$ i6 S
-9       2.00000     host ssd-compute02                                   5 A1 `  Y2 o  ~7 C# V
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 . W# O) _6 i* j1 O) G+ V
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000
9 d4 d' B3 M4 {- V-10       2.00000     host ssd-compute03                                   " N8 G: t- D$ Q0 Z2 q9 |; G9 i8 I+ z
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
# D" D& P' k, R" V( Y% _  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
0 Z7 p* W  L. L. w. ?* c -1             0 root default                                             
3 u9 t, B' U) A' y: ~9 y[root@compute01 ~]# ceph osd crush 9 A3 q; I) p5 G( i! Z: m) p$ H5 S; p
add                              remove                           set-device-class+ Y4 \- P: D0 |6 Y% w8 I- {% e
add-bucket                       rename-bucket                    set-tunable9 n+ ?, T" C6 X- _/ [$ j
class                            reweight                         show-tunables  M+ h& |+ V1 c3 T/ G; {; i
create-or-move                   reweight-all                     swap-bucket1 G8 p" c: V, l
dump                             reweight-subtree                 tree5 j7 E# j, r1 M. R4 h; q
get-device-class                 rm                               tunables* T! n# @# g4 i
get-tunable                      rm-device-class                  unlink
+ y/ i2 J0 n# ?9 }0 h. v  J9 plink                             rule                             weight-set8 U  g7 z8 w; Q) z" |( l
ls                               set                              
# ~+ V7 {, O+ ]move                             set-all-straw-buckets-to-straw2  * a; g. w) J! `' F* K3 Z
[root@compute01 ~]# ceph osd crush  set osd.6 1.00000 host=ssd-compute010 K' ]& x2 I& |0 W
set item id 6 name 'osd.6' weight 1 at location {host=ssd-compute01} to crush map
8 [7 k+ a+ m  A- c[root@compute01 ~]# ceph osd crush  set osd.7 1.00000 host=ssd-compute02' O) F* ]' k& `* H
set item id 7 name 'osd.7' weight 1 at location {host=ssd-compute02} to crush map
4 j& J8 S  A# |# W$ q( I$ z[root@compute01 ~]# ceph osd crush  set osd.8 1.00000 host=ssd-compute033 O& ?/ n1 n; Q9 ^
set item id 8 name 'osd.8' weight 1 at location {host=ssd-compute03} to crush map" {0 Z% W/ ]* q# n
[root@compute01 ~]# ceph osd tree5 t- W  K: b' U( d7 _/ y7 z
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF ! g5 I: Q7 _$ b; n9 Y
-7       2.00000 root hdd-bigdata                                         6 C/ k0 H# x8 s. I9 |
-14       1.00000     host hdd-bigdata-compute01                           
- N; u7 B- O5 N2 Z, ?: Y 12   hdd 1.00000         osd.12                       up  1.00000 1.00000
( \) D$ w1 v6 u, G-15       1.00000     host hdd-bigdata-compute02                           
( v( J7 |* P/ I" Z1 p2 |! i 13   hdd 1.00000         osd.13                       up  1.00000 1.00000
7 N! ?( E9 c. ~5 ~; }( i-16             0     host hdd-bigdata-compute03                           
: ]8 N5 C  ?' q0 U -6       3.00000 root hdd-smalldata                                       4 U9 H# r1 |( j( w: q5 l* J( A; ~& @
-17       1.00000     host hdd-smalldata-compute01                         0 ]* u& h8 S# S) f: d' k7 d7 k9 R
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 1 n: p2 c- w5 r+ E' v8 D6 A
-18       1.00000     host hdd-smalldata-compute02                         7 \- t4 y, r. B& ?" |5 _, [
10   hdd 1.00000         osd.10                       up  1.00000 1.00000 * \- Q- `$ A, Z; t( A
-19       1.00000     host hdd-smalldata-compute03                         + B2 _7 g/ D, ~& G5 s) d1 j% k! N
11   hdd 1.00000         osd.11                       up  1.00000 1.00000
7 j0 D0 x& e3 F) N, Q6 ]: N8 h -5             0 root ssd-smalldata                                       ; N+ d# U- w/ O
-11             0     host ssd-smalldata-compute01                         / Z8 n$ y& Z. r& D* u
-12             0     host ssd-smalldata-compute02                         , T; Y# M& s4 n2 I7 p9 G  j/ p, O
-13             0     host ssd-smalldata-compute03                         7 u3 u( @2 R, O3 `+ U% f- L
-4       9.00000 root ssd                                                 ) ?3 d) |* |# C" V4 S
-8       3.00000     host ssd-compute01                                   * R& V$ y3 a$ }. q
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000 4 v" h' h% G& P) `. d
  1   ssd 1.00000         osd.1                        up  1.00000 1.00000 ( {! O1 T9 ~$ a* X" O3 P
  6   ssd 1.00000         osd.6                        up  1.00000 1.00000 ' \  S/ ^; f* p. X
-9       3.00000     host ssd-compute02                                   5 k. V! d' ^& n8 A2 ^( T
  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 4 k6 f' ^5 w! U
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000
. P2 u$ d7 O) N# S6 ^5 l  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 * i3 F! W' N  p0 e- Q6 ?1 y% s" g
-10       3.00000     host ssd-compute03                                   # V. l9 ^* \  P4 ^! [; S
  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
; K7 \2 L& ^! o& W: k- x  5   ssd 1.00000         osd.5                        up  1.00000 1.00000 % |7 Y0 b& K8 ?) A3 e8 ]3 H0 p
  8   ssd 1.00000         osd.8                        up  1.00000 1.00000 : i% U2 K" b- W. N
-1             0 root default                                             
# K1 V* Y! `3 ]( F[root@compute01 ~]# df -TH% t  \- J# W, P7 X0 H2 b' R: K3 v
Filesystem              Type      Size  Used Avail Use% Mounted on
! q2 a3 r0 y) p( ldevtmpfs                devtmpfs   68G     0   68G   0% /dev
, y; ~# V  A2 h" C3 V# Stmpfs                   tmpfs      68G     0   68G   0% /dev/shm% T; \5 m; [" ~
tmpfs                   tmpfs      68G  9.8M   68G   1% /run
, o( o4 P) O6 {+ y( l/ ntmpfs                   tmpfs      68G     0   68G   0% /sys/fs/cgroup
) y0 J. K5 u- h( U1 P/dev/mapper/centos-root xfs       582G  2.8G  579G   1% /
! d- l2 G. o. N3 W; C/dev/sda1               xfs       1.1G  158M  907M  15% /boot2 D/ b7 ~  h1 t7 ^; D5 m7 X9 y
tmpfs                   tmpfs      14G     0   14G   0% /run/user/01 D4 \( j2 n. z0 l& S4 A1 h
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-0
8 v' S6 g& Y9 ?  Stmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-13 l) s  q/ U/ U1 k) ?
tmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-6
3 x, g" V6 t! b& f2 a1 Xtmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-9
+ I3 C# V/ ^/ ~9 htmpfs                   tmpfs      68G   54k   68G   1% /var/lib/ceph/osd/ceph-122 |( r* g; {3 x6 U3 |- h$ R
[root@compute01 ~]# % N" \1 s* b, I) C9 n* W8 _
[root@compute01 ~]# , l. g9 k( Y7 f  X% l0 `
[root@compute01 ~]#
: F, C( }0 k' C3 p" h[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute02 6 X( M0 c) ]1 d- w0 D
removed item id -12 name 'ssd-smalldata-compute02' from crush map
- l" O! R4 F/ }; e- x1 H/ s[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute01 1 H/ r$ z7 [+ G) Y$ A
removed item id -11 name 'ssd-smalldata-compute01' from crush map
! s9 F% V. G- O  p7 a[root@compute01 ~]# ceph osd crush remove ssd-smalldata-compute03
$ Q# {1 b3 D6 \' Y  U% b3 Q; y6 i  ]removed item id -13 name 'ssd-smalldata-compute03' from crush map
4 n$ d6 _9 _5 G7 Q. O[root@compute01 ~]# ceph osd crush remove ssd-smalldata
7 u7 t% J2 v7 c) j! {* ^' c/ V/ j. FError EBUSY: (16) Device or resource busy" Z; L2 P8 K- S; m( C' h
[root@compute01 ~]# ceph osd tree) j0 H. a& |! S4 ?# y
ID  CLASS WEIGHT  TYPE NAME                        STATUS REWEIGHT PRI-AFF . M% s! B- w* P  {, M
-7       2.00000 root hdd-bigdata                                         ) X( `3 ?6 D7 n; G
-14       1.00000     host hdd-bigdata-compute01                           
2 J5 G( A/ A/ l4 [. s 12   hdd 1.00000         osd.12                       up  1.00000 1.00000 0 y! @' K: z. \. G! {
-15       1.00000     host hdd-bigdata-compute02                           
/ E! X( B% M2 Y5 w$ }  }' X0 v 13   hdd 1.00000         osd.13                       up  1.00000 1.00000 & z! Y& `% H$ [
-16             0     host hdd-bigdata-compute03                           * N1 ^/ N4 H. q8 }4 [
-6       3.00000 root hdd-smalldata                                       * }( P* C: m( O$ m5 f
-17       1.00000     host hdd-smalldata-compute01                         4 B/ W7 X, C  Q5 j# W" f, |
  9   hdd 1.00000         osd.9                        up  1.00000 1.00000 " M8 B) Q+ u6 e  d  |% l* E
-18       1.00000     host hdd-smalldata-compute02                         / L. C$ T4 g7 r3 J8 V' [
10   hdd 1.00000         osd.10                       up  1.00000 1.00000 % S7 r4 N8 L$ X' C3 y0 c# ~% d
-19       1.00000     host hdd-smalldata-compute03                         & u- a' g  J+ o- t
11   hdd 1.00000         osd.11                       up  1.00000 1.00000
( N( M& Y  ^( q5 Y. p+ P- Q' k) a -5             0 root ssd-smalldata                                       - y8 [6 e- ~6 v9 Q- B* I: W
-4       9.00000 root ssd                                                
9 O+ D+ R0 W7 @* I8 A+ N! B) y+ q2 g -8       3.00000     host ssd-compute01                                   0 [2 I2 U2 h2 N/ G4 P) T
  0   ssd 1.00000         osd.0                        up  1.00000 1.00000
5 G3 K7 }& s( `5 s. d- F: i  1   ssd 1.00000         osd.1                        up  1.00000 1.00000
+ j& X0 s! ?4 f% E  6   ssd 1.00000         osd.6                        up  1.00000 1.00000
* m4 e& P3 d7 k -9       3.00000     host ssd-compute02                                   
: F2 Z+ d# V6 R/ X. q. k  2   ssd 1.00000         osd.2                        up  1.00000 1.00000 ) S& J" e, T) Z( i  D  N# Z
  3   ssd 1.00000         osd.3                        up  1.00000 1.00000 3 O" c9 C8 _" W- D4 j. Z
  7   ssd 1.00000         osd.7                        up  1.00000 1.00000 0 j% T( a4 Q2 [+ b$ v; p
-10       3.00000     host ssd-compute03                                   
4 U% u8 q5 N  A  K" f  4   ssd 1.00000         osd.4                        up  1.00000 1.00000
' `3 v6 h1 J8 ~5 d) K. b/ s  5   ssd 1.00000         osd.5                        up  1.00000 1.00000
# u3 u% ]; ~. `7 K  8   ssd 1.00000         osd.8                        up  1.00000 1.00000
. ^6 `) Z7 |- Q' V' M2 e  E! ~ -1             0 root default                                             
, _+ a) L5 D* G2 R; u[root@compute01 ~]#
; p! L. J6 C; m" Z8 E
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:06 , Processed in 0.036571 second(s), 25 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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