rbd无法map

默认开启了rbd的一些属性

1
2
[root@ceph1 ~]# ceph --show-config|grep rbd|grep features
rbd_default_features = 61

RBD属性表:

61的意思是上面图中的bit码相加得到的值
对rbd进行内核的map操作

1
2
3
4
5
[root@ceph1 ~]# rbd map mytest
rbd: sysfs write failed
RBD image feature set mismatch. You can disable features unsupported by the kernel with "rbd feature disable".
In some cases useful info is found in syslog - try "dmesg | tail" or so.
rbd: map failed: (6) No such device or address

根据提示查询打印的信息

1
2
[root@ceph1 ~]# dmesg | tail
[10440.462708] rbd: image mytest: image uses unsupported features: 0x3c

这个地方提示的很清楚了,不支持的属性0x3c,0x3c是16进制的数值,换算成10进制是3*16+12=60
60的意思是不支持:

1
2
3
32+16+8+4 = exclusive-lock, object-map, fast-diff, deep-flatten

也就是不支持这些属性,现在动态关闭这些属性

关闭这些属性

1
rbd feature disable {poolname}/{imagename} {feature}

如果不想动态的关闭,那么在创建rbd之前,在配置文件中设置这个参数即可

1
2
3
4
5
6
7
rbd_default_features = 3

关于属性支持的,目前到内核4.6仍然只支持

layering,striping = 1 + 2

这两个属性
Donate