安装ceph客户端
apt install ceph -y # ubuntu
yum install ceph -y # centos
查看现有的pool
ceph osd lspools
创建pool
ceph osd pool create pool_name pg_num
查看pool列表
ceph osd lspools
创建块存储
rbd create image-name --size megabytes --pool pool_name
查看块设备列表
rbd ls
查看快设备信息
rbd --image image-name info
映射块设备
rbd map image-name --pool pool-name --id username
查看映射的块设备
rbd showmapped
关闭不支持的特性
rbd feature disable image-name unsupported-feature1,unsupported-feature2
取消映射
rbd unmap /dev/rbd/pool-name/image-name
创建块设备并挂载
rbd create image-name --size megabytes --pool pool_name
rbd map image-name --pool pool-name --id username
rbd showmapped
mkfs.ext4 -q 块设备
mkdir 挂载目录
mount 块设备 挂载目录
块设备扩容
rbd resize rbd/navy --size 2048
resize2fs /dev/rbd0
创建用户
# 创建s3用户
radosgw-admin user create --uid="admin" --display-name="admin"
# 创建子用户
radosgw-admin subuser create --uid="admin-swift" --subuser="admin:swift" --access=full
查看子用户信息
radosgw-admin user info --uid=admin