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

相关推荐
BullSmall4 分钟前
Jenkins LTS JDK21 docker-compose.yml(生产可用)
运维·docker·jenkins
公众号:fuwuqiBMC5 分钟前
(转自“服务器BMC”)服务器BMC芯片功能——LTPI简介
运维·服务器
倚栏听雨_ylty16 分钟前
H3C交换机关闭Telnet和HTTP服务实例
运维·网络·tcp/ip·网络安全
念何架构之路19 分钟前
docker-Builder镜像构建
运维·docker·容器
xywww16823 分钟前
Claude Opus 5 API 接入实战:国内项目上线前的网络、Key、限流和排错清单
大数据·linux·网络·数据库·云计算·aws
ShineWinsu25 分钟前
对于Linux:http的解析
linux·网络·c++·网络协议·http·请求·响应
易筋紫容28 分钟前
为什么做了 DevOps,你还是管不好开源依赖?
运维·开源·devops
强里秋千墙外道32 分钟前
Ubuntu 开机 Kernel Panic:HWE 内核升级失败 + NVIDIA DKMS 踩坑实录
linux·运维·ubuntu
宸津-代码粉碎机33 分钟前
Jar热部署进阶实战|修复原生方案OOM与类冲突问题,生产级无BUG优化方案
java·大数据·服务器·开发语言·前端·人工智能·python
coder!mq34 分钟前
什么是泛型?有什么好处?
linux·运维·服务器·面试题·八股文