Ceph对象存储

复制代码
Ceph对象存储
	1.概念
	对象存储(Object Storage)是一种用于存储大量非结构化数据的架构模型
	它使用简单的HTTP或HTTPS协议进行文件访问,而不是传统的文件系统API
	与传统的文件系统存储方式不同,对象存储不是将数据存储在目录或文件夹中,而是将数据存储为独立的数据对象,每个对象都包含数据本身、元数据(描述数据的属性)以及唯一标识符

	2.Ceph对象存储服务的搭建及使用
	
		1)启动rgw服务
		ceph orch apply rgw myrgw --placement="3 ceph1 ceph2 ceph3" --port 8080
	
		2)创建对象存储的用户
		radosgw-admin user create --uid=testuser --display-name="Test User" --email=test@tedu.cn --access-key=12345 --secret-key=67890
		radosgw-admin:这是Ceph提供的命令行工具,用于管理RADOS Gateway的配置和用户。

		3)安装awscli.noarch对象存储的操作工具
			yum -y install awscli.noarch
			
			配置s3 cli工具
			aws configure --profile=ceph
			AWS Access Key ID [None]: 12345         #输入access_key
			AWS Secret Access Key [None]: 67890     #输入secret_key
			Default region name [None]: #回车
			Default output format [None]: #回车

		4)创建桶:桶为存储的对象提供了一个全局唯一的命名空间,桶的名称唯一,不会与其他桶中的对象冲突。
			aws --profile=ceph --endpoint=http://ceph1:8080 s3 mb s3://testbucket

		--profile=ceph:包含了访问AWS服务所需的凭证(Access Key和Secret Key),上面指定的	
		--endpoint=http://ceph1:8080**:这指定了S3服务的端点(Endpoint)
		s3 mb s3://testbucket:s3 mb是"make bucket"的缩写,而s3://testbucket指定了要创建的桶的名称。

		5)文件上传
			aws --profile=ceph --endpoint=http://ceph1:8080 --acl=public-read-write s3 cp /etc/hosts s3://testbucket/hosts.txt
			查看桶里面的文件
			aws --profile=ceph --endpoint=http://ceph1:8080 s3 ls s3://testbucket/
			访问测试
			curl http://ceph1:8080/testbucket/hosts.txt

		6)文件下载
			wget -O zhuji.txt http://ceph1:8080/testbucket/hosts.txt
	访问
		通过浏览器访问https://192.168.88.11:8443,用户名为admin,密码是安装时指定的123456

Ceph对象存储

1.概念

对象存储(Object Storage)是一种用于存储大量非结构化数据的架构模型

它使用简单的HTTP或HTTPS协议进行文件访问,而不是传统的文件系统API

与传统的文件系统存储方式不同,对象存储不是将数据存储在目录或文件夹中,而是将数据存储为独立的数据对象,每个对象都包含数据本身、元数据(描述数据的属性)以及唯一标识符

2.Ceph对象存储服务的搭建及使用

1)启动rgw服务

ceph orch apply rgw myrgw --placement="3 ceph1 ceph2 ceph3" --port 8080

2)创建对象存储的用户

radosgw-admin user create --uid=testuser --display-name="Test User" --email=test@tedu.cn --access-key=12345 --secret-key=67890

radosgw-admin:这是Ceph提供的命令行工具,用于管理RADOS Gateway的配置和用户。

3)安装awscli.noarch对象存储的操作工具

yum -y install awscli.noarch

配置s3 cli工具

aws configure --profile=ceph

AWS Access Key ID None: 12345 #输入access_key

AWS Secret Access Key None: 67890 #输入secret_key

Default region name None: #回车

Default output format None: #回车

4)创建桶:桶为存储的对象提供了一个全局唯一的命名空间,桶的名称唯一,不会与其他桶中的对象冲突。

aws --profile=ceph --endpoint=http://ceph1:8080 s3 mb s3://testbucket

--profile=ceph:包含了访问AWS服务所需的凭证(Access Key和Secret Key),上面指定的

--endpoint=http://ceph1:8080**:这指定了S3服务的端点(Endpoint)

s3 mb s3://testbucket:s3 mb是"make bucket"的缩写,而s3://testbucket指定了要创建的桶的名称。

5)文件上传

aws --profile=ceph --endpoint=http://ceph1:8080 --acl=public-read-write s3 cp /etc/hosts s3://testbucket/hosts.txt

查看桶里面的文件

aws --profile=ceph --endpoint=http://ceph1:8080 s3 ls s3://testbucket/

访问测试

curl http://ceph1:8080/testbucket/hosts.txt

6)文件下载

wget -O zhuji.txt http://ceph1:8080/testbucket/hosts.txt

访问

通过浏览器访问https://192.168.88.11:8443,用户名为admin,密码是安装时指定的123456

相关推荐
三言老师20 小时前
K8s集群运行时自动化运维全覆盖落地实操(下)
linux·运维·服务器·网络
Super 含20 小时前
Android 启动优化(五):线程、GC 与 IO 为什么会拖慢启动?
java·服务器·数据库
ltl21 小时前
HAProxy HTX 与 HTTP 路径:内部表示、改写落点与协议分叉
linux
ltl21 小时前
可拆分 OS:CXL 内存池化如何动摇本地 DRAM 假设
linux
ltl21 小时前
Tetragon 强制执行:Override 与 SIGKILL 各自保证什么
linux
lengjingzju21 小时前
编译与调试完全指南—第6章 性能分析工具
linux
土星云SaturnCloud1 天前
产线SOP动作级AI监管方案:土星云SE110S-WC8赋能合规识别、预警与效率分析
大数据·服务器·人工智能·ai·边缘计算
躺不平的理查德1 天前
嵌入式 Linux 系统移植与 SD 卡量产镜像制作
linux·运维·服务器
一直走下去-明1 天前
centos7无法安装tcpreplay
linux·运维
吹什么轩1 天前
linux网络:TCP套接字基础
linux·网络·tcp/ip