使用内核态的RBD模块(正常情况)
- 创建测试RBD Image:
[root@ceph-node1 tmp]# rbd create rbd/bench-image --size 1G
[root@ceph-node1 tmp]# rbd ls -p rbd
bench-image
test-image
[root@ceph-node1 tmp]# rbd info rbd/bench-image
rbd image 'bench-image':
size 1024 MB in 256 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.5ddff6b8b4567
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
flags:
- 在一台虚拟机中使用这个Image:
[root@ceph-node1 ~]# rbd map bench-iamge
rbd: sysfs write failed
In some cases useful info is found in syslog - try "dmesg | tail" or so.
rbd: map failed: (2) No such file or directory
- 查看系统Log:
[root@ceph-node1 ~]# dmesg | tail
Oct 18 02:30:24 ceph-node1 kernel: libceph: client374111 fsid cbc99ef9-fbc3-41ad-a726-47359f8d84b3
Oct 18 02:30:24 ceph-node1 kernel: rbd: image bench-image: image uses unsupported features: 0x38
从日志可以看出,是RBD Image的有些feature,当前内核不支持,所以需要disable这些feature,rbd支持disable功能。
- 内核及系统版本
[root@ceph-node1 ~]# uname -r
3.10.0-514.26.2.el7.x86_64
[root@ceph-node1 ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
- Disable RBD Image feature
[root@ceph-node1 ~]# rbd feature disable bench-image fast-diff
[root@ceph-node1 ~]# rbd feature disable bench-image object-map
[root@ceph-node1 ~]# rbd feature disable bench-image exclusive-lock
[root@ceph-node1 ~]# rbd feature disable bench-image deep-flatten
上面这些feature也可以通过一条命令直接disable,不过需要注意feature先后顺序。
- 查看当前Image的feature