欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Ceph map时报错:“rbd: sysfs write failed”

程序员文章站 2022-06-13 21:17:07
...

Ceph map时报错:“rbd: sysfs write failed”

Ceph map时报错:“rbd: sysfs write failed”

报错内容如下:

[[email protected] my-cluster]# rbd map kurt --pool rbd --id admin
rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable kurt object-map fast-diff deep-flatten".
In some cases useful info is found in syslog - try "dmesg | tail".
rbd: map failed: (6) No such device or address

系统环境:

OS:Centos 7.7,Ceph:14.2.5

[[email protected] my-cluster]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[[email protected] my-cluster]# ceph -v
ceph version 14.2.5 (ad5bd132e1492173c85fda2cc863152730b16a92) nautilus (stable)

原因分析:

出现这种错误的原因是OS kernel不支持块设备镜像的一些特性,导致映射失败。

[[email protected] my-cluster]# rbd info kurt
rbd image 'kurt':
        size 1 GiB in 256 objects
        order 22 (4 MiB objects)
        snapshot_count: 0
        id: 14aba61bbdf84
        block_name_prefix: rbd_data.14aba61bbdf84
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
        op_features: 
        flags: 
        create_timestamp: Thu Dec 26 13:49:39 2019
        access_timestamp: Thu Dec 26 13:49:39 2019
        modify_timestamp: Thu Dec 26 13:49:39 2019

解决方法:

其实在报错信息里也非常明确的指出了解决方法。

RBD image feature set mismatch. You can disable features unsupported by the kernel with “rbd feature disable kurt object-map fast-diff deep-flatten”.

把 " "中间的那段rbd feature disable kurt object-map fast-diff deep-flatten复制出来并执行就可以了。

[[email protected] my-cluster]# rbd feature disable kurt object-map fast-diff deep-flatten
[[email protected] my-cluster]# rbd info kurt
rbd image 'kurt':
        size 1 GiB in 256 objects
        order 22 (4 MiB objects)
        snapshot_count: 0
        id: 14aba61bbdf84
        block_name_prefix: rbd_data.14aba61bbdf84
        format: 2
        features: layering, exclusive-lock
        op_features: 
        flags: 
        create_timestamp: Thu Dec 26 13:49:39 2019
        access_timestamp: Thu Dec 26 13:49:39 2019
        modify_timestamp: Thu Dec 26 13:49:39 2019

可以看到 features:下的object-map fast-diff deep-flatten都已经被禁用了。
再次map,OK搞定!

[[email protected] my-cluster]# rbd map kurt --pool rbd --id admin
/dev/rbd2
相关标签: Ceph