Created a RBD image
$ rbd create --size 4096 docker_test
Then, an error occurred when the RBD mirror was mapped to a local device on the Ceph client side.
$ rbd map docker_test --name client.adminrbd: sysfs write failedRBD 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.
Reason:
RBD Some features of the image, OS kernel is not supported, so the mapping fails. We look at what features are supported by the image.
$ rbd info docker_testrbd 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
You can see the feature feature column, because my OS kernel only support layering, others do not support, so we need to disable some of the unsupported features.
Method One:
The unsupported features of this RBD mirror are directly diable:
$ rbd feature disable docker_test exclusive-lock object-map fast-diff deep-flatten
Method Two:
When you create a RBD image, you specify the features you want, such as:
$ rbd create --size 4096 docker_test --image-feature layering
Method Three:
If you want to do this once and for all, modify the Ceph configuration file/etc/ceph/ceph.conf on the server that created the RBD Image command, and under the Global section, add
rbd_default_features = 1
Then create the RDB image.
$ rbd create --size 4096 docker_test
After using the above three methods, view the information of the RBD image.
$ rbd info docker_testrbd 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:
Try to map the RDB image to this parcel device again, success!
$ rbd map docker_test --name client.admin/dev/rbd0
RDB Map Error RBD Sysfs write failed