标签:fail des article UI color 同步 device 内核 取消
创建存储池: ceph osd pool create {pool-name} {pg-num} [{pgp-num}] [replicated] [crush-ruleset-name] [expected-num-objects]
删除存储池: ceph osd pool delete {pool-name} [{pool-name} --yes-i-really-really-mean-it]
重命名存储池: ceph osd pool rename {current-pool-name} {new-pool-name}
ceph osd pool create test_pool 128 128 replicated
ceph osd lspools
创建块设备镜像命令是rbd create --size {megabytes} {pool-name}/{image-name},如果pool_name不指定,则默认的pool是rbd。 下面的命令将创建一个10GB大小的块设备:
rbd create --size 10240 test_image -p test_pool
删除镜像: rbd rm test_pool/test_image
查看块设备的命令是rbd info {pool-name}/{image-name}
hcy@admin_server:~/my-cluster$ rbd info test_pool/test_image
rbd image ‘test_image‘:
size 1024 MB in 256 objects
order 22 (4096 kB objects)
block_name_prefix: rbd_data.372674b0dc51
format: 2
features: layering
flags:
create_timestamp: Sat Sep 23 18:16:28 2017
注意到上面的rbd info显示的RBD镜像的format为2,Format 2的RBD镜像支持RBD分层,是实现Copy-On-Write的前提条件。
块设备映射到操作系统的命令是rbd map {image-name}
sudo rbd map test_pool/test_image
取消映射: rbd unmap test_pool/test_image
此时如果打印:
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 |www.bajieyy.org tail" or so.
rbd: map failed: (6) No such device or address
表示当前系统不支持feature,禁用当前系统内核不支持的feature:
rbd feature disable test_pool/test_image exclusive-lock, object-map, fast-diff, deep-flatten
重新映射:
hcy@admin_server:~/my-cluster$ sudo rbd map test_pool/test_image
/dev/rbd0
sudo mkfs.ext4 /dev/rbd/test_pool/test_image
sudo mkdir /mnt/ceph-block-device
sudo chmod 777 /mnt/ceph-block-device
sudo mount /dev/rbd/test_pool/test_image /mnt/ceph-block-device
cd /mnt/ceph-block-device
至此,Ceph的块设备搭建已完成。但是目前我遇到了一个问题,两台Client机器挂载了同一个镜像,两台机器的文件列表不能保持同步,可能要用到rbd mirror相关的知识,这方面还没接触,后续跟进更新。
Ceph v12.2 Luminous 块存储(RBD)搭建
标签:fail des article UI color 同步 device 内核 取消
原文地址:http://www.cnblogs.com/xinshijue6080/p/7683931.html