建立了一個rbd鏡像docker
$ rbd create --size 4096 docker_test
而後,在Ceph client端將該rbd鏡像映射爲本地設備時出錯。服務器
$ rbd map docker_test --name client.admin 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鏡像的一些特性,OS kernel並不支持,因此映射失敗。咱們查看下該鏡像支持了哪些特性。code
$ rbd info docker_test rbd image 'docker_test': size 4096 MB in 1024 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.43702ae8944a format: 2 features: layering, exclusive-lock, object-map, fast-diff, deep-flatten flags:
能夠看到特性feature一欄,因爲我OS的kernel只支持layering,其餘都不支持,因此須要把部分不支持的特性disable掉。
方法一:
直接diable這個rbd鏡像的不支持的特性:orm
$ rbd feature disable docker_test exclusive-lock object-map fast-diff deep-flatten
方法二:
建立rbd鏡像時就指明須要的特性,如:it
$ rbd create --size 4096 docker_test --image-feature layering
方法三:
若是還想一勞永逸,那麼就在執行建立rbd鏡像命令的服務器中,修改Ceph配置文件/etc/ceph/ceph.conf,在global section下,增長io
rbd_default_features = 1
再建立rdb鏡像。ast
$ rbd create --size 4096 docker_test
經過上述三種方法後,查看rbd鏡像的信息。form
$ rbd info docker_test rbd image 'docker_test': size 4096 MB in 1024 objects order 22 (4096 kB objects) block_name_prefix: rbd_data.43a22ae8944a format: 2 features: layering flags:
再次嘗試映射rdb鏡像到本地塊設備,成功!test
$ rbd map docker_test --name client.admin /dev/rbd0