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

处理过程osd down掉了,服务状态正常HEALTH_WARN 2 osds down; Reduced data availability: 29 pgs

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-10-27 10:26:02 | 显示全部楼层 |阅读模式
ceph health detail ) J, ~/ b/ a) \& Q4 D3 ?1 ^
HEALTH_WARN 2 osds down; Reduced data availability: 29 pgs inactive# }9 n+ N/ L! b
OSD_DOWN 2 osds down
' V6 F3 [+ m4 k    osd.6 (root=hdd,host=hdd-ceph1) is down
! t& ^& u6 g4 ^, |: V7 i    osd.11 (root=hdd,host=hdd-ceph1) is down. W7 M* c- f, j
PG_AVAILABILITY Reduced data availability: 29 pgs inactive
# U1 N% g  _$ z( b1 M) ^# n$ ]    pg 11.1 is stuck inactive for 81874.695636, current state unknown, last acting []3 I, D. Y' F' i0 \( R. u' B
    pg 11.5 is stuck inactive for 81874.695636, current state unknown, last acting []
3 W* ?3 Z7 I3 V2 U& R/ a    pg 11.22 is stuck inactive for 81874.695636, current state unknown, last acting []
. D& U$ M. A1 b* Q" ?2 |    pg 11.31 is stuck inactive for 81874.695636, current state unknown, last acting []  t9 t2 e" o' I3 \' `
    pg 11.3b is stuck inactive for 81874.695636, current state unknown, last acting []0 M  [, K( e, V2 J6 b
    pg 11.5d is stuck inactive for 81874.695636, current state unknown, last acting []
$ j1 p' S( y* ]6 G- R    pg 11.5f is stuck inactive for 81874.695636, current state unknown, last acting []
4 u1 s# {- t& w    pg 11.63 is stuck inactive for 81874.695636, current state unknown, last acting []- O$ L& P9 g6 N  q5 [8 H% W& B
    pg 11.67 is stuck inactive for 81874.695636, current state unknown, last acting []. C8 ]* k0 J2 O+ i$ w6 h
    pg 11.79 is stuck inactive for 81874.695636, current state unknown, last acting []( h5 y$ \# r3 {! w  f+ Y9 L& X
    pg 11.83 is stuck inactive for 81874.695636, current state unknown, last acting []6 B7 V' `, Z7 _& h& O8 l- L7 R4 B
    pg 11.90 is stuck inactive for 81874.695636, current state unknown, last acting []. U! Z6 @3 H' M5 x2 F1 n- a& z
    pg 11.91 is stuck inactive for 81874.695636, current state unknown, last acting []8 h1 u$ F7 K& X* Y: ~
    pg 11.93 is stuck inactive for 81874.695636, current state unknown, last acting []9 J- m9 \* D: _8 L* W- v
    pg 11.a1 is stuck inactive for 81874.695636, current state unknown, last acting []
6 X" p6 h4 g1 N; I6 W    pg 11.a4 is stuck inactive for 81874.695636, current state unknown, last acting []
# b2 f/ X& t6 B+ F    pg 11.aa is stuck inactive for 81874.695636, current state unknown, last acting []
, Z0 f) K7 J  W0 x    pg 11.b3 is stuck inactive for 81874.695636, current state unknown, last acting []  I4 g( i3 D0 O5 B6 s2 K4 {, |
    pg 11.b6 is stuck inactive for 81874.695636, current state unknown, last acting []' x( w/ i( n* a5 n8 Q
    pg 11.b8 is stuck inactive for 81874.695636, current state unknown, last acting []
' j( z! r( ]$ C$ k& O6 z: \    pg 11.ca is stuck inactive for 81874.695636, current state unknown, last acting []2 {$ d" S2 u9 I! F+ Y, h
    pg 11.cf is stuck inactive for 81874.695636, current state unknown, last acting []; Z. {* G! L8 q9 F- ?; W( T3 b* S
    pg 11.da is stuck inactive for 81874.695636, current state unknown, last acting []% Y( c' c5 ^. A; m. b  O4 x

. R& I/ F! d* f) |* b# d/ V1 l- k" B: a3 }

. X- C) x$ C& M$ {( `& [
; ?  Q2 j0 p+ Z    pg 11.e6 is stuck inactive for 81874.695636, current state unknown, last acting []
4 Z- ?" }8 M0 q2 _) O% h    pg 11.e8 is stuck inactive for 81874.695636, current state unknown, last acting []# J( n2 R" X7 u! ]4 t
    pg 11.ec is stuck inactive for 81874.695636, current state unknown, last acting []3 Y% e. k3 R- L% d* E! p
    pg 11.ef is stuck inactive for 81874.695636, current state unknown, last acting []' R- I* Y0 R8 s+ B7 L1 j+ @! n4 o
    pg 11.fa is stuck inactive for 81874.695636, current state unknown, last acting []% U8 B% c/ T2 M2 i" \5 v  f) I& C% W
    pg 11.fb is stuck inactive for 81874.695636, current state unknown, last acting []- o; x: U6 L7 p4 A4 u! M

  f$ B; y- C, v# R. f( Gpg好像卡住了。4 T/ f0 b7 E7 a. Q

4 A" x3 Z, X5 ?4 }- j9 u3 J7 L7 n  e
日志刷新很快:
+ ?8 S1 h5 g1 \* L
! ^3 S5 }2 K2 `) t. f$ F, C2021-10-27 10:22:59.527 7f9b2d0f5700  1 osd.6 pg_epoch: 23810 pg[10.1c( v 4595'732 (0'0,4595'732] local-lis/les=13109/131=[13109,23810)/3 crt=4595'732 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [8] -> [14,8], acting [8] -> [14,ting 4611087854031667199
3 C$ }( w1 Q  ?2021-10-27 10:22:59.528 7f9b2e0f7700  1 osd.6 pg_epoch: 23739 pg[8.49d( v 4595'444 (0'0,4595'444] local-lis/les=13081/130081,23739)/5 crt=4595'444 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14] -> [], acting [14] -> [], acting1087854031667199! |* h7 J" J5 P) f3 L
2021-10-27 10:22:59.539 7f9b2e8f8700  1 osd.6 pg_epoch: 23770 pg[8.339( v 4595'513 (0'0,4595'513] local-lis/les=13099/13113099,23770)/9 crt=4595'513 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14,8] -> [14], acting [14,8] -> [1acting 4611087854031667199# e9 l$ B# ^% r' @% e/ L
2021-10-27 10:22:59.540 7f9b2e0f7700  1 osd.6 pg_epoch: 23746 pg[8.49d( v 4595'444 (0'0,4595'444] local-lis/les=13081/13013081,23746)/5 crt=4595'444 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [] -> [14], acting [] -> [14], acti10878540316671997 U, o% I+ L$ k9 b; k5 q2 c2 j
2021-10-27 10:22:59.541 7f9b2c8f4700  1 osd.6 pg_epoch: 23808 pg[8.4aa( v 4595'411 (0'0,4595'411] local-lis/les=13114/131i=[13112,23808)/11 crt=4595'411 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [22,8,14] -> [22,8], acting [2254031667199 upacting 46110878540316671992 N  _2 q* N2 u. f4 P9 F% N& ?& T
2021-10-27 10:22:59.544 7f9b2c8f4700  1 osd.6 pg_epoch: 23810 pg[8.4aa( v 4595'411 (0'0,4595'411] local-lis/les=13114/1310 pi=[13112,23810)/10 crt=4595'411 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [22,8] -> [22,8,14], acting 87854031667199 upacting 4611087854031667199
+ {3 G  t9 a! p: l& R2021-10-27 10:22:59.545 7f9b2e8f8700  1 osd.6 pg_epoch: 23773 pg[8.339( v 4595'513 (0'0,4595'513] local-lis/les=13099/131=[13099,23773)/9 crt=4595'513 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14] -> [14,8], acting [14] -> [1upacting 4611087854031667199$ ]  ]; }+ Y7 o; O$ J0 e
2021-10-27 10:22:59.546 7f9b2e0f7700  1 osd.6 pg_epoch: 23749 pg[8.49d( v 4595'444 (0'0,4595'444] local-lis/les=13081/130i=[13081,23749)/5 crt=4595'444 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14] -> [23,14], acting [14] -> 99 upacting 4611087854031667199
) Y5 y6 L+ [. E$ w7 f. T# d! _( C; b2021-10-27 10:22:59.566 7f9b2d0f5700  1 osd.6 pg_epoch: 23838 pg[10.1c( v 4595'732 (0'0,4595'732] local-lis/les=13109/13113109,23838)/3 crt=4595'732 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14,8] -> [14], acting [14,8] -> [1acting 4611087854031667199: p1 Z9 r* W0 X9 J
2021-10-27 10:22:59.566 7f9b2d0f5700  1 osd.6 pg_epoch: 23838 pg[10.1c( v 4595'732 (0'0,4595'732] local-lis/les=13109/13113109,23838)/3 crt=4595'732 lcod 0'0 unknown NOTIFY mbc={}] state<Start>: transitioning to Stray
' \3 R4 K) l0 @; \, v7 A: `2021-10-27 10:22:59.597 7f9b2c8f4700  1 osd.6 pg_epoch: 23838 pg[8.4aa( v 4595'411 (0'0,4595'411] local-lis/les=13114/131pi=[13112,23838)/11 crt=4595'411 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [22,8,14] -> [22,14], acting [87854031667199 upacting 46110878540316671995 ^) r3 y8 D2 C! i) [
2021-10-27 10:22:59.597 7f9b2c8f4700  1 osd.6 pg_epoch: 23838 pg[8.4aa( v 4595'411 (0'0,4595'411] local-lis/les=13114/131pi=[13112,23838)/11 crt=4595'411 lcod 0'0 unknown NOTIFY mbc={}] state<Start>: transitioning to Stray
7 e6 B3 @$ e! z: H" l4 p! B2021-10-27 10:22:59.606 7f9b2d0f5700  1 osd.6 pg_epoch: 23739 pg[8.765( v 4595'410 (0'0,4595'410] local-lis/les=13094/130094,23739)/3 crt=4595'410 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14] -> [], acting [14] -> [], acting10878540316671994 L# M' z- @, h0 v8 ?4 ?2 @
2021-10-27 10:22:59.612 7f9b2e8f8700  1 osd.6 pg_epoch: 23808 pg[8.339( v 4595'513 (0'0,4595'513] local-lis/les=13099/1313099,23808)/9 crt=4595'513 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [14,8] -> [8], acting [14,8] -> [8],g 4611087854031667199& p( m$ b) m  j
2021-10-27 10:22:59.617 7f9b2e8f8700  1 osd.6 pg_epoch: 23810 pg[8.339( v 4595'513 (0'0,4595'513] local-lis/les=13099/131=[13099,23810)/9 crt=4595'513 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [8] -> [14,8], acting [8] -> [14,ting 4611087854031667199+ X9 ?! |! P( A2 [
2021-10-27 10:22:59.620 7f9b2d8f6700  1 osd.6 pg_epoch: 23808 pg[8.38b( v 4595'408 (0'0,4595'408] local-lis/les=13099/13113099,23808)/12 crt=4595'408 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [23,14] -> [23], acting [23,14] -> upacting 4611087854031667199$ ^5 M( ^4 p/ N2 N9 d
2021-10-27 10:22:59.622 7f9b2d0f5700  1 osd.6 pg_epoch: 23746 pg[8.765( v 4595'410 (0'0,4595'410] local-lis/les=13094/13013094,23746)/3 crt=4595'410 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [] -> [14], acting [] -> [14], acti1087854031667199+ c9 @( }0 M% H0 I) [0 b6 P& `/ c& _8 {
2021-10-27 10:22:59.624 7f9b2d8f6700  1 osd.6 pg_epoch: 23810 pg[8.38b( v 4595'408 (0'0,4595'408] local-lis/les=13099/131i=[13099,23810)/12 crt=4595'408 lcod 0'0 unknown NOTIFY mbc={}] start_peering_interval up [23] -> [23,14], acting [23] ->199 upacting 46110878540316671995 G) t( R. f' g7 U2 e9 S2 h
' w4 {' J  Y5 e: Q8 P; |

$ G$ h2 L; }1 F. ?重启两个pg所在的osd9 a" }7 {& R7 o7 D4 U" g% t2 f
systemctl ceph-osd@x.service/ J! d/ D4 o4 u  e5 W" b# r* d

3 D. Q8 C9 i0 n( j: J8 I

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-10-27 10:28:57 | 显示全部楼层
[root@ceph1 ~]# systemctl status ceph-osd@6.service * f/ K3 o  \& Q2 B1 W- |
ceph-osd@6.service - Ceph object storage daemon osd.6, B' d$ D  S( I9 i& ^" o
   Loaded: loaded ([url=]/usr/lib/systemd/system/ceph-osd@.service[/url]; enabled-runtime; vendor preset: disabled)
  y2 {) h3 v# z9 ~   Active: active (running) since Wed 2021-10-27 10:22:44 CST; 11min ago9 P9 r) n/ A: _+ i% r( y
  Process: 6169 ExecStartPre=/usr/lib/ceph/ceph-osd-prestart.sh --cluster ${CLUSTER} --id %i (code=exited, status=0/SUCCESS)
, n* ?* ], C! f' E5 s, j3 K( v Main PID: 6175 (ceph-osd)% k# E6 ~* H1 U" f5 w* r- i9 |
   CGroup: /system.slice/system-ceph\x2dosd.slice/ceph-osd@6.service% J& ^* l1 D) k* R' O
           └─6175 /usr/bin/ceph-osd -f --cluster ceph --id 6 --setuser ceph --setgroup ceph: Q/ [1 \8 c+ W2 \8 k6 ]
Oct 27 10:22:44 ceph1 systemd[1]: Starting Ceph object storage daemon osd.6...
* i) V& |9 j7 z  Z3 V0 ^Oct 27 10:22:44 ceph1 systemd[1]: Started Ceph object storage daemon osd.6.7 w  U4 T4 p. \2 A9 |0 n6 L7 Z
Oct 27 10:22:55 ceph1 ceph-osd[6175]: 2021-10-27 10:22:55.875 7f9b532a0a80 -1 osd.6 23718 log_to_monitors {default=true}
' \; z. Y' M% `  [4 hOct 27 10:29:37 ceph1 ceph-osd[6175]: 2021-10-27 10:29:37.277 7f9b45125700 -1 osd.6 25440 set_numa_affinity unab...ectory: m" Q9 a# I& n/ y
Hint: Some lines were ellipsized, use -l to show in full.
0 C! i/ f/ }, G1 j9 P# \7 a$ _% ]1 [* `6 p" U
状态正常,但是ceph health deatil却不正常:
  ^* C5 A$ z9 ?& M" ~; ^3 n1 R/ [2 osds down
/ [1 S2 K' `. v2 M# v            Reduced data availability: 29 pgs inactive. q2 q# z7 o* ~3 F7 V7 Z% {
% }  ]& P. e# y) i

) h2 M- s8 d& K% }8 n0 @看到网上的处理过程:
. b5 ?; g# R4 P. e; s& x: [( e/ P% g
显示这3个 pg 卡住了
运行 pg query, 查看该 pg 的具体信息, 显示:
[root@controller ~]# ceph pg 3.1e query8 Z" i3 s% q, q
. x0 P: V$ q) N( w! p( O
/ F5 H, p5 r3 _3 Z$ ?' t
Error ENOENT: i don't have pgid 3.1e
: o. j! Z" Q* K; F1 a2 h; @% s( L  f$ }3 B
无法找到该 pg id.
运行 pg dump_stuck unclean, 显示:
3 z* ~! f7 `/ j- p# }3 E$ G
分析
看来是这几个 pgid 彻底找不到了. 我的 osd pool 有三个, 分别叫 l1 (1副本), l2 (2副本), l3 (3副本).
估计可能是之前写入 1 副本的数据由于硬盘挂掉导致的数据丢失.
既然是1副本, 也不要求数据可靠性了. 并且本身存储的也是一些下载到一半的数据, 也没什么关系
修正
通过阅读 CEPH 官方 PG troubleshooting 文档 , 发现了解决方案:
POOL SIZE = 1
If you have the osd pool default size set to 1, you will only have one copy of the object. OSDs rely on other OSDs to tell them which objects they should have.
If a first OSD has a copy of an object and there is no second copy, then no second OSD can tell the first OSD that it should have that copy. For each placement group mapped to the first OSD (see ceph pg dump),

  C% a' _  E8 H% s) b8 h# i- V
you can force the first OSD to notice the placement groups it needs by running:
ceph osd force-create-pg <pgid>
即, 多 osd 副本可以互相通知 pg 信息, 但是单副本就会丢, 为了恢复这个pg, 我们可以强行创建它.
[root@controller ~]# ceph osd force-create-pg 3.1e+ ~+ ]0 o, J3 U1 p  m! H

3 w% r8 Q4 I* T7 k/ t
+ v$ L: R7 H& W0 M
Error EPERM: This command will recreate a lost (as in data lost)
8 O- q/ F" y1 E& g7 v. zPG with data in it, such that the cluster will give up ever trying to recover the lost data.  
$ m/ T6 \6 y- g% M6 B2 q& M) `8 @% i: `, k; t3 }
+ C9 x4 W! F+ ^* ^: f; K! x3 U
Do this only if you are certain that all copies of the PG are in fact lost and you are willing to accept that the data is permanently destroyed. ' M, f$ }7 a: U3 x' g* x) \
Pass --yes-i-really-mean-it to proceed. : s% D& Q' M+ J2 d0 h$ @

' x  `1 m! e( b! q3 w5 c& ?& o4 {
* Z/ i: y  u8 h1 J: W
运行创建命令, 提示, 运行会永久的丢失该 pg 的数据, 需要加上 --yes-i-really-mean-it.
[backcolor=rgb(245, 245, 245) !important][url=]https://common.cnblogs.com/images/copycode.gif[/url]$ ~; r6 w" b( ~0 N6 ]

, R. L( B- K8 [9 n: L& S, S9 Z+ |0 ^/ {) e& u+ w
[root@controller ~]# ceph osd force-create-pg 3.1e --yes-i-really-mean-it3 P$ ~" h  w. h& S
) S5 E9 a7 }5 Q2 M' L1 Q- N

2 t. P. K7 r3 d( Lpg 3.1e now creating, ok. E1 t/ W- ~4 }! |/ o% Y, O
1 M! m( ]* j* |4 u9 |
. G; [+ R" A" P% O7 @$ T/ w
[root@controller ~]# ceph osd force-create-pg 3.b --yes-i-really-mean-it
0 @5 y% Y+ }' E2 _' S, m9 _; }. v3 u
" k/ E; I3 }, ?0 K
pg 3.b now creating, ok
1 S* @9 d9 Y& Q5 g% ]
$ d8 \" E: E. j- X' O
- |& p7 L! {4 l% O0 K6 S7 e
[root@controller ~]# ceph osd force-create-pg 3.4 --yes-i-really-mean-it$ z, R0 p! y! y  h. a
( ^# Z$ G$ ~6 K7 _9 f
, @- s! b8 B/ k( p1 W% j5 W' i
pg 3.4 now creating, ok 8 z2 J# P; t+ |; f( w+ }2 M
8 T2 w5 A/ y0 x+ [
感觉有些可行性,于是直接走最后一步:
1 ~4 j7 h, I/ B+ Y% g" {% G4 M* k! b
7 n- v# u1 S/ \; a$ u% ?[root@ceph1 ~]# ceph osd force-create-pg 11.1 --yes-i-really-mean-it1 F/ y; g! O  z% q6 w4 A' |
pg 11.1 now creating, ok7 b6 T4 x' i. E: G
[root@ceph1 ~]# ( S  R) I7 a5 \: M8 O6 V/ W
[root@ceph2 ~]# ceph -s
/ ^6 a* v" v) [) t% @  cluster:3 `8 P& r5 m  A2 `
    id:     4d8d7309-ad9e-4566-bee5-69b8d805dd574 u& u" d% |" Y3 G
    health: HEALTH_OK
# b3 [2 a3 }$ l$ k; w% i5 o: _7 j 4 ^- d, d) Z' {3 q  b% A6 j
  services:; [5 @- B3 c7 Q( y! E
    mon: 5 daemons, quorum ceph1,ceph2,ceph3,compute1,compute2 (age 28m)8 o2 q( b( C. P
    mgr: ceph2(active, since 22h), standbys: compute3, compute2, compute1, ceph3, ceph1* A0 i2 A# R% B4 x) J
    osd: 36 osds: 36 up (since 47s), 36 in (since 10m)
- l8 i* A7 b7 a& h0 Z  j
* }3 y( R6 E) F6 o  data:4 g+ h  H* {1 g$ v* T! _1 a
    pools:   9 pools, 5888 pgs
0 r# M5 o+ c* L" O: t' u) L    objects: 143.19k objects, 549 GiB
7 R. ?, G9 V3 k1 R6 _    usage:   5.9 TiB used, 127 TiB / 133 TiB avail0 T1 q) U' N; L( X% i& i/ ~
    pgs:     5888 active+clean" b8 X6 i  Z1 g9 C8 s

6 S/ Y' s! N- o2 \  io:0 i/ s& f5 m3 `: D6 X; r' i# V
    client:   258 KiB/s rd, 35 KiB/s wr, 224 op/s rd, 6 op/s wr
( y3 W" E+ z) e+ H. T# p; L9 F$ e
' T1 x2 w( Y3 s3 S
4 a3 g: H% ]8 G, ~- l$ \( K9 ]7 i1 K: \, x5 U# p
没想到ok状态了。
. t4 {- }1 \3 a" X% Y& ^) o9 d0 t; L8 l$ d: _

' v0 F, G+ @+ n. j- E: r( u1 M/ N+ N# S0 h+ Y+ S4 z: v, {

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-10-27 10:33:21 | 显示全部楼层
[root@ceph1 ~]# ceph osd force-create-pg 11.5 --yes-i-really-mean-it
* z1 S, i' S1 H+ c- \5 D- ?pg 11.5 now creating, ok# h# L9 E8 {; b
[root@ceph1 ~]# ceph osd force-create-pg 11.22 --yes-i-really-mean-it
6 H( X" ?" m& i1 f1 \pg 11.22 now creating, ok
. C8 Y! u' X- L! g5 T# J7 p
8 d, b2 i6 k! ~
( r2 @9 i9 F! p, K% j/ z$ Y& Z- f3 D
ceph 修复成功。# r6 T3 m  {0 ~( j0 |2 y* S2 R

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-10-27 10:40:56 | 显示全部楼层
[root@ceph1 ~]# ceph pg dump_stuck ) L! g; I& M5 T& i& P: P: e
degraded    inactive    stale       unclean     undersized  
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 02:02 , Processed in 0.014577 second(s), 23 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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