使用内核态的RBD

本文介绍了如何在内核态下使用RBD模块,包括创建和禁用特定特性以适配内核版本。当禁用特性后仍无法使用RBD内核模块,作者转向使用rbd-nbd模块,并详细阐述了编译和安装nbd模块的过程,以解决在低版本内核中使用RBD的问题。
摘要由CSDN通过智能技术生成

使用内核态的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
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值