ceph修复pg inconsistent

1、收到异常情况如下:

health: HEALTH_ERR
2 scrub errors
Possible data damage: 1 pg inconsistent

2、查看详细信息

ceph health detail
HEALTH_ERR 2 scrub errors; Possible data damage: 1 pg inconsistent
OSD_SCRUB_ERRORS 2 scrub errors
PG_DAMAGED Possible data damage: 1 pg inconsistent
pg 2.2f5 is active+clean+inconsistent, acting [22,2,27]

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

ceph osd find 22
{
“osd”: 22,
“ip”: “1xx.xx.xx.xx:6812/73885”,
“osd_fsid”: “99a7644b-50d6-4bd3-9a8b-36d499c8ddfd”,
“crush_location”: {
“host”: “ceph3”,
“root”: “default”
}
}

4.

然后到 进行修复

1、停止osd
systemctl stop ceph-osd@22.service
2、刷入日志
ceph-osd -i 22 –flush-journal
3、启动osd
systemctl start ceph-osd@22.service
可以确认集群恢复OK