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

相关推荐
Christal_pyy3 小时前
树莓派4基于Debian GNU/Linux 12 (Bookworm)添加多个静态ipv4网络
linux·网络·debian
csbDD4 小时前
2025年网络安全(黑客技术)三个月自学手册
linux·网络·python·安全·web安全
李狗蛋儿啊4 小时前
zero自动化框架搭建---Git安装详解
运维·git·自动化
小金的学习笔记5 小时前
如何在本地和服务器新建mysql用户和密码
运维·服务器·mysql
s_fox_5 小时前
nginx ngx_http_module(7) 指令详解
运维·nginx·http
EasyNVR5 小时前
EasyRTC智能硬件:实时畅联、沉浸互动、消音护航
运维·服务器·网络·安全·音视频·webrtc·p2p
CarryBest5 小时前
Jenkins 环境搭建---基于 Docker
运维·jenkins
若云止水6 小时前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_process_options
运维·nginx
s_fox_6 小时前
nginx ngx_http_module(9) 指令详解
运维·nginx·http
风口上的猪20156 小时前
thingboard告警信息格式美化
java·服务器·前端