Ceph RGW Federated Architecture

本文介绍如何在Ceph集群中配置联邦架构,包括多个区域和区域内的多个分区,并详细说明了区域、分区及实例的命名约定。此外,还介绍了如何利用PowerDNS实现跨区域的全局RADOS网关命名空间,使用户可以轻松地在不同区域间创建和访问存储桶。

1 . Overview
In Ceph version 0.67 Dumpling and beyond, you may configure each Ceph Object Gateway to participate in a federated architecture, with multiple regions, and with multiple zones for a region.

Region: A region represents a logical geographic area and contains one or more zones. A cluster with multiple regions must specify a master region.
Zone: A zone is a logical grouping of one or more Ceph Object Gateway instance(s). A region has a master zone that processes client requests.
Documents:
http://docs.ceph.com/docs/master/radosgw/federated-config/

example 1 :

NAMING FOR THE MASTER REGION
Before configuring the cluster, defining region, zone and instance names will help you manage your cluster. Let’s assume the region represents the United States, and we refer to it by its standard abbreviation.
United States: us
Let’s assume the zones represent the Eastern and Western United States. For continuity, our naming convention will use {region name}-{zone name}format.
United States, East Region: us-east
United States, West Region: us-west
Finally, let’s assume that zones may have more than one Ceph Object Gateway instance per zone. For continuity, our naming convention will use{region name}-{zone name}-{instance} format.
United States Region, Master Zone, Instance 1: us-east-1
United States Region, Secondary Zone, Instance 1: us-west-1

example 2:

NAMING FOR THE SECONDARY REGION
Before configuring the cluster, defining region, zone and instance names will help you manage your cluster. Let’s assume the region represents the European Union, and we refer to it by its standard abbreviation.
European Union: eu
Let’s assume the zones represent the Eastern and Western European Union. For continuity, our naming convention will use {region name}-{zonename} format.
European Union, East Region: eu-east
European Union, West Region: eu-west
Finally, let’s assume that zones may have more than one Ceph Object Gateway instance per zone. For continuity, our naming convention will use{region name}-{zone name}-{instance} format.
European Union Region, Master Zone, Instance 1: eu-east-1
European Union Region, Secondary Zone, Instance 1: eu-west-1

data sync between master zone and a secondary zone
这里写图片描述

data sync between master region and a secondary region

这里写图片描述

sum up:
这里写图片描述

2. Global RADOS Gateway Namespace

PowerDNS RADOS Gateway backend
A backend for PowerDNS to direct RADOS Gateway bucket traffic to the correct regions.
For example, two regions exist, US and EU.
EU: s3.isscloud.eu
US: s3.isscloud.us
A global namespace s3.isscloud.com exists for all our regions

Bucket ‘dashboard’ exists in the region EU and ‘washboard’ in US.
dashboard.s3.isscloud.com will return a CNAME to dashboard.s3.isscloud.eu
washboard.s3.isscloud.com will return a CNAME to washboard.s3.isscloud.us

PowerDNS must be compiled with Remote HTTP backend support enabled, this is not default.
https://github.com/ceph/ceph/tree/master/src/powerdns

PowerDNS How to :
This allows us to create multiple regions (eu, us, asia, etc) but keep one global namespace to make it easy to consume for our end-users.

Users can create a bucket in the region they like, but they never have to worry about wich hostname to use. We take care of that

This PowerDNS backend is in the Ceph master branch and can be installed as a WSGI application behind Apache

PowerNDS Steps:

  1. –enable-remotebackend-http

PowerDNS must be compiled with Remote HTTP backend support enabled, this is not default Afterwards point PowerDNS to localhost on port 80:
PowerDNS configuration

launch=remote
remote-connection-string=http:url=http://localhost:6780/dns

  1. rgw-pdns.conf.in
    [powerdns]
    listen_addr = 127.0.0.1
    listen_port = 6780

dns_zone = rgw.local.lan
dns_soa_record = dns1.icann.org. hostmaster.icann.org. 2012080849 7200 3600 1209600 3600
dns_soa_ttl = 3600
dns_default_ttl = 60

rgw_access_key = myAccessKey
rgw_secret_key = mySecretKey
rgw_endpoint = localhost
rgw_admin_entry = admin

debug = no

  1. WSGI Server pdns-backend-rgw.py
    You can run this backend directly behind an Apache server with mod_wsgi
    LoadModule wsgi_module modules/mod_wsgi.so

### Ceph RGW 简介 Ceph RGWCeph Object Gateway)是 Ceph 存储系统中的对象网关服务,它提供了与 Amazon S3 和 OpenStack Swift 兼容的接口,允许用户通过熟悉的 API 来访问 Ceph 存储集群中的对象存储。这使得 Ceph 能够无缝集成到使用 S3 或 Swift 协议的现有应用程序和云环境中。 ### 功能特性 - **多协议支持**:Ceph RGW 支持 S3 和 Swift 两种广泛使用的对象存储协议,为不同需求的用户提供了灵活的选择。例如,使用 Amazon S3 API 的应用程序可以直接与 Ceph RGW 交互,而使用 OpenStack Swift 的云环境也能轻松集成 Ceph 存储。 - **数据冗余与高可用性**:依托 Ceph 存储集群的强大特性,Ceph RGW 能够实现数据的多副本存储和自动数据修复。当某个存储节点出现故障时,系统会自动将数据副本复制到其他可用节点,确保数据的安全性和服务的连续性。 - **用户认证与授权**:支持多种认证方式,如 AWS 风格的访问密钥认证,可对不同用户或用户组进行细粒度的权限控制。管理员可以根据业务需求,为用户分配不同的读写权限,保护数据的安全性。 - **数据版本控制**:允许用户对存储的对象进行版本管理,方便在数据被误删除或修改时进行恢复。每个对象的不同版本都会被保存,用户可以随时访问和恢复到指定版本。 - **多租户支持**:Ceph RGW 可以在一个存储集群中为多个租户提供独立的存储服务,每个租户有自己的命名空间和权限控制,实现资源的隔离和共享。 ### 配置方法 以下是一个简单的 Ceph RGW 配置示例: 1. **安装 Ceph RGW**:在 Ceph 集群节点上安装 Ceph RGW 服务。 ```bash sudo apt-get install radosgw radosgw-agent ``` 2. **配置 Ceph RGW**:编辑 Ceph 配置文件 `/etc/ceph/ceph.conf`,添加以下内容: ```plaintext [client.rgw.gateway] host = <hostname> rgw frontends = civetweb port=8080 rgw zone = <zone-name> rgw realm = <realm-name> ``` 其中,`<hostname>` 是运行 RGW 服务的节点主机名,`port` 是 RGW 服务监听的端口号,`<zone-name>` 和 `<realm-name>` 是 RGW 区域和领域的名称。 3. **创建 RGW 用户**:使用 `radosgw-admin` 工具创建 RGW 用户,并获取访问密钥。 ```bash radosgw-admin user create --uid="testuser" --display-name="Test User" ``` 该命令将创建一个名为 `testuser` 的 RGW 用户,并返回该用户的访问密钥(Access Key 和 Secret Key)。 ### 使用指南 以下是一个使用 s3fs 挂载 Ceph RGW 存储的示例: ```bash s3fs ceph-rgw /home/s3fs -o passwd_file=~/.passwd-s3fs -o use_path_request_style -o url=http://192.168.123.172:7480 ``` 其中,`ceph-rgw` 是存储桶名称,`/home/s3fs` 是挂载点,`~/.passwd-s3fs` 是存储访问密钥的文件,`http://192.168.123.172:7480` 是 Ceph RGW 服务的 URL。 ### 相关技术信息 - **架构设计**:Ceph RGW 基于 Ceph 的 RADOS(Reliable Autonomic Distributed Object Store)层构建,通过中间件层将 S3 和 Swift 协议的请求转换为 RADOS 对象操作。这种架构使得 Ceph RGW 能够充分利用 Ceph 集群的分布式存储能力,同时提供灵活的接口。 - **性能优化**:可以通过调整 Ceph RGW 的配置参数、优化网络环境和存储硬件等方式来提高性能。例如,增加 RGW 前端的并发连接数、使用高速网络和 SSD 存储设备等。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值