ceph修复pg inconsistent

本文介绍了一种处理 Ceph 集群中出现的 PG (Placement Group) 不一致问题的方法。通过停止并重启出现问题的 OSD (Object Storage Daemon),刷新日志,以及手动修复错误的对象来解决该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

异常情况

1、收到异常情况如下:

HEALTH_ERR 37 scrub errors; Possible data damage: 1 pg inconsistent

2、查看详细信息

#ceph health detail
HEALTH_ERR 37 scrub errors; Possible data damage: 1 pg inconsistent
OSD_SCRUB_ERRORS 37 scrub errors
PG_DAMAGED Possible data damage: 1 pg inconsistent
pg 1.dbc is active+clean+inconsistent, acting [55,71,25]

3、预处理办法

一般情况采用 ceph pg [pgid],但是经过观察,并不能解决。

参考处理办法

https://ceph.com/geen-categorie/ceph-manually-repair-object/

Just move the object away with the following:

  • stop the OSD that has the wrong object responsible for that PG
  • flush the journal (ceph-osd -i <id> --flush-journal)
  • move the bad object to another location
  • start the OSD again
  • call ceph pg repair 17.1c1

我的处理过程

找出异常的 pg,然后到对应的osd所在主机上修复。


root@CLTQ-064-070:~# ceph osd find 55
{
    "osd": 55,
    "ip": "172.29.64.76:6817/789571",
    "crush_location": {
        "host": "CLTQ-064-076",
        "root": "default"
    }
}

这里表示是主机CLTQ-064-076
然后到 进行修复

1、停止osd

systemctl stop ceph-osd@55.server

2、刷入日志

ceph-osd -i 55 --flush-journal

3、启动osd

systemctl start ceph-osd@55.server

4、修复(一般不需要)

ceph pg repair 1.dbc

5、查看pg所在osd

# ceph pg ls|grep 1.dbc

1.dbc      3695                  0        0         0       0 12956202159 1578     1578                active+clean 2018-04-03 19:34:45.924642  2489'4678 2494:19003 [55,71,25]         55 [55,71,25]             55  2489'4678 2018-04-03 18:32:56.365327       2489'4678 2018-04-03 18:32:56.365327 

可以确认集群恢复OK。PG还是在 osd.55上。

转载于:https://blog.51cto.com/3168247/2094597

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值