ceph块存储

本文档详细记录了在Linux环境中利用Ceph创建存储池testpool,上传对象testobject,创建并管理RBD镜像testimage,将其映射为块设备以及最后删除存储池的完整流程。通过这些步骤,展示了Ceph在对象存储和块设备管理方面的基本操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.创建一个存储池,存储池的名称为testpool

[root@localhost ~]# ceph osd pool create testpool 128
pool 'testpool' created
[root@localhost ~]# ceph osd pool ls
testpool


2.上传一个对象到testpool存储池,对象的名称为testobject

[root@localhost ~]# touch hello.txt
[root@localhost ~]# rados -p testpool put testobject hello.txt
[root@localhost ~]# rados -p testpool ls
testobject


3.创建一个RBD的image,image名称为testimage,大小为100M

[root@localhost ~]# rbd create testpool/testimage --size 100M
[root@localhost ~]# rbd info testpool/testimage
rbd image 'testimage':
	size 100 MiB in 25 objects
	order 22 (4 MiB objects)
	snapshot_count: 0
	id: 1140963892e
	block_name_prefix: rbd_data.1140963892e
	format: 2
	features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
	op_features: 
	flags: 
	create_timestamp: Tue Jul 26 19:32:56 2022
	access_timestamp: Tue Jul 26 19:32:56 2022
	modify_timestamp: Tue Jul 26 19:32:56 202


4.将testimage映射为块设备

[root@localhost ~]# rbd device map testimage


5.删除testpool存储池

[root@localhost ~]# vim /etc/ceph/ceph.conf

mon_allow_pool_delete = true
 

[root@localhost ~]# systemctl restart ceph-mon.target
[root@localhost ~]# ceph osd pool delete testpool testpool --yes-i-really-really-mean-it
pool 'testpool' removed

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值