ceph修复pg inconsistent( scrub errors)

异常情况

1、收到异常情况如下:

bash 复制代码
OSD_SCRUB_ERRORS 12 scrub errors
PG_DAMAGED Possible data damage: 1 pg inconsistent
    pg 6.d is active+remapped+inconsistent+backfill_wait, acting [5,7,4]

2、查看详细信息

登录后复制

bash 复制代码
#ceph health detail
HEALTH_ERR 12 scrub errors; Possible data damage: 1 pg inconsistent
OSD_SCRUB_ERRORS 12 scrub errors
PG_DAMAGED Possible data damage: 1 pg inconsistent
    pg 6.d is active+remapped+inconsistent+backfill_wait, acting [5,7,4]

2、预处理办法

集群出现pg状态变为 inconsistent 状态,inconsistent状态是pg通过scrub检测到某个或者某些对象在副本之间出现了不一致

解决方法:

1.找到pgid

bash 复制代码
ceph pg dump | grep inconsistent

2.通过repair修复对应的pg

bash 复制代码
ceph pg repair pgid

完成

但是经过观察,并不能解决。

3、我的处理过程

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

bash 复制代码
[root@intelligence-b-10 ~]#  ceph osd find 5
{
    "osd": 5,
    "ip": "10.21.230.91:6802/2032",
    "crush_location": {
        "host": "intelligence-b-12",
        "root": "default"
    }
}
[root@intelligence-b-10 ~]#  ceph osd find 7
{
    "osd": 7,
    "ip": "10.21.230.92:6801/2059",
    "crush_location": {
        "host": "intelligence-b-13",
        "root": "default"
    }
}
[root@intelligence-b-10 ~]#  ceph osd find 4
{
    "osd": 4,
    "ip": "10.21.230.90:6800/2084",
    "crush_location": {
        "host": "intelligence-b-11",
        "root": "default"
    }
}

这里表示是主机intelligence-b-12

然后到 进行修复

1、停止osd

bash 复制代码
systemctl stop ceph-osd@5.service

2、刷入日志

bash 复制代码
ceph-osd -i 5 --flush-journal

3、启动osd

bash 复制代码
systemctl start ceph-osd@5.service

4、修复(一般不需要)

bash 复制代码
ceph pg repair 6.d

5、查看ceph的状态

bash 复制代码
ceph -s
相关推荐
SeanQhl4 天前
基于华为云ECS平台的分布式存储系统Ceph-部署指导
ceph·分布式存储·华为云ecs
あ-5 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》第十八章:Rook-Ceph 企业级备份、容灾与数据保护体系
ceph
あ-6 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》- 第六章:Kubernetes Rook-Ceph 运维手册 v1.0(生产版)
ceph
あ-6 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》- 第十二章:Rook-Ceph 监控、告警与可观测性体系ds
ceph
あ-6 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》- 第十一章:Rook-Ceph 升级、扩容与生命周期管理
ceph
あ-6 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》- 第十章:Rook-Ceph 安全加固与生产合规
ceph
あ-6 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》- 第七章:Rook-Ceph 生产故障案例库
ceph
あ-6 天前
Proxmox Ceph 集群故障排查手册
ceph
あ-6 天前
《Kubernetes Rook-Ceph 运维手册 v1.0(生产版)》- 第八章:Rook-Ceph 性能优化与生产调优
ceph
RobinDevNotes10 天前
Palmier Pro:AI时代的Mac视频编辑器
人工智能·ceph·macos·ai·音视频·视频编辑·mcp