ceph rgw multisite基本用法
Realm:
Zonegroup: 理解为数据中心,由一个或多个Zone组成,每个Realm有且仅有 一个Master Zonegroup,用于处理系统变更,其他的称为Slave Zonegroup,元数据与Master Zonegroup保持一致;
Zone: Zone是一个逻辑概念,包含一个或者多个RGW实例。每个Zonegroup有且仅有一个Master Zone,用于处理bucket和user等元数据变更。
Period: 保存realm当前的配置信息,使用epoch维护版本信息。
Metadata Sync:Zone是一个逻辑概念,包含一个或者多个RGW实例。每个Zonegroup有且仅有一个Master Zone,用于处理bucket和user等元数据变更。
systemctl restart ceph-radosgw@rgw.hostname
创建realm:
A realm contains the notion of periods. Each period represents the state of the zone group and zone configuration in time.Each time you make a change to a zonegroup or zone, update the period and commit it.
realm里所有的元数据名称都是全局唯一的,无法创建同名的用户(uid)和bucket, container;
radosgw-admin realm create --rgw-realm=Giant --default
查看存在的realm:
radosgw-admin realm list
创建Master zonegroup:
删除 Default ZoneGroup并创建Master ZoneGroup
为了前向兼容,所以会存在默认的zonegroup,需要删除
radosgw-admin zonegroup delete --rgw-zonegroup=default
radosgw-admin zonegroup create --rgw-zonegroup=beijing --endpoints=beijing.com --master --default
查看zonegroup相关信息:
radosgw-admin zonegroup list
radosgw-amdin zonegroup get {zonegroup name}
创建Master zone:
删除default Zone 并创建Master Zone
为了前向兼容,所以默认存在zone,需要删除
radosgw-admin zone delete --rgw-zone=default
#创建Master zone,并指定zonegroup
radosgw-admin zone create --rgw-zonegroup=beijing --rgw-zone=beijing --endpoints=beijing.com --access-key=admin --secret=admin --default --master
Secondary Zones:
You must execute metadata operations, such as user creation, on a host within the master zone. The master zone and the secondary zone can receive bucket operations, but the secondary zone redirects bucket operations to the master zone. If the master zone is down, bucket operations will fail.
Bucket Sharding
主要为了解决.rgw.buckets.index pool的性能问题;该pool下存放了bucket index data;
rgw_override_bucket_index_max_shards
default: 0 #不启用分片
推荐值: {number of objects expected in a bucket / 100,000}
max value: 7877
The default value for rgw_max_objs_per_shard is 100k objects per shard.
动态修改sharding值:
rgw_dynamic_reshading = true
rgw_reshard_num_logs: The number of shards for the resharding log. The default value is 16.
rgw_reshard_bucket_lock_duration: The duration of the lock on a bucket during resharding. The default value is 120 seconds.
rgw_dynamic_resharding: Enables or disables dynamic resharding. The default value is true.
rgw_max_objs_per_shard: The maximum number of objects per shard. The default value is 100000 objects per shard.
rgw_reshard_thread_interval: The maximum time between rounds of reshard thread processing. The default value is 600 seconds.
将bucket加入resharding 队列:
radosgw-admin bucket reshard add --bucket <bucket_name> --num-shards <new number of shards>
查看resharding队列:
radosgw-admin bucket reshard list
手动执行reshard:
radosgw-admin bucket reshard process
取消在bucket resharding期间取消resharding:
radosgw-admin bucket reshard cancel --bucket <bucket_name>
压缩:compression
压缩插件:
zlib: 支持
snappy, zstd: 预览版
radosgw-admin zone placement modify --rgw-zone=default --placement-id=default-placement --compression=zlib
After enabling or disabling compression, restart the Ceph Object Gateway instance so the change will take effect.
$ radosgw-admin bucket stats --bucket=
{
...
"usage": {
"rgw.main": {
"size": 1075028,
"size_actual": 1331200,
"size_utilized": 592035,
"size_kb": 1050,
"size_kb_actual": 1300,
"size_kb_utilized": 579,
"num_objects": 104
}
},
...
}
The size_utilized and size_kb_utilized fields represent the total size of compressed data in bytes and kilobytes respectively.
Quota 管理:
Quotas include the maximum number of objects in a bucket and the maximum storage size in megabytes.
IMPORT: Buckets with a large number of objects can cause serious performance issues.
The recommended maximum number of objects in a one bucket is 100,000. To increase this number,
configure bucket index sharding
Set User Quotas:
radosgw-admin quota set --quota-scope=user --uid=<uid> [--max-objects=<num objects>] [--max-size=<max size>]
eg:
radosgw-admin quota set --quota-scope=user --uid=johndoe --max-objects=1024 --max-size=1024
A negative value for num objects and / or max size means that the specific quota attribute check is disabled.
Ebable and Disable User Quotas:
#radosgw-admin quota enable --quota-scope=user --uid=<uid>
#radosgw-admin quota disable --quota-scope=user --uid=<uid>
Set Bucket Quotas:
#radosgw-admin quota set --uid=<uid> --quota-scope=bucket [--max-objects=<num objects>] [--max-size=<max size]
Enable and Disable Bucket Quotas
#radosgw-amdin quota enable --quota-scope=bucket --uid=<uid>
#radosgw-admin quota-disable --quota-scope=bucket --uid=<uid>
Get Quota Settings
#radosgw-admin user info --uid=<uid>
Update Quota Stats
#radosgw-admin user stats --uid=<uid> --sync-stats
Get User Quota Usage Stats
#radosgw-admin user stats --uid=<uid>
Quota Cache:
rgw bucket quota ttl, rgw user quota bucket sync interval, rgw user quota sync interval.
统计用户
#radosgw-admin usage show --uid=johndeo --start-data=2012-03-01 --end-date=2012-04-01
#radosgw-amdin usage show --show-log-entri
清理孤儿对象:
create a new log pool:
1、rados mkpool .log
2、radosgw-admin orphans find --pool=<data_pool> --job-id=<job_name> [--num-shards=<num_shards>] [--orphan-stale-secs=<seconds>]
<Search for orphan objects>
3、radosgw-admin orphans find --pool=.rgw.buckets --job-id=abc123
4、Clean up the search data:
radosgw-amdin orphans finish --job-id=abc123
Zones:
Ceph Object Gateway supports the notion of zones. A zone defines a logical group consisting of one or more Ceph Object Gateway instances.
ceph rgw multisite基本用法的更多相关文章
- 趣解 ceph rgw multisite data sync 机制
multisite是ceph rgw对象数据异地容灾备份的一个有效方案,笔者希望深入理解该技术,并应用于生产环境中,然而rgw的这部分代码晦涩难懂,笔者多次尝试阅读,仍云里雾里不解其意,最终流着泪咬着 ...
- Ceph RGW Multisite 数据同步流程图
- ceph rgw java sdk 使用域名访问服务时需要设置s3client的配置项 PathStyleAccess 为true, 负责将报域名异常
Caused by: java.net.UnknownHostException: my-new-bucket.s3.yyclouds.com at java.net.InetAddress.getA ...
- CEPH RGW多 ZONE的配置
相关的名称解释 Region :可以理解为区域,是基于地理位置的逻辑划分:如:华南,华北之类,包含多个region的Ceph集群必须指定一个master region,一个region可以包含一个或者 ...
- Ceph 之Multisite 下的bucket reshard
目录 一.背景和问题 二.bucket reshard 过程 主集群信息汇总 Multisite 下手动reshard References 一.背景和问题 默认情况下只有当单个bucket承载的ob ...
- Ceph RGW服务 使用s3 java sdk 分片文件上传API 报‘SignatureDoesNotMatch’ 异常的定位及规避方案
import java.io.File; import com.amazonaws.AmazonClientException; import com.amazonaws.auth.profile ...
- Ceph RGW 创建默认的pool
使用Ceph-deploy完成RGW服务部署后(最好是在部署RGW服务前建立如下这些pool),使用sudo ceph osd lspools 命令,会发现RGW自动以默认参数创建了N个rgw相关的p ...
- Ceph RGW 和 niginx 配置要点
cat /etc/nginx/sites-enabled/rgw.conf server { listen 80 default; #server_name .com .com.cn .net .cn ...
- CEPH RGW集群和bucket的zone group 不一致导致的404异常解决 及 使用radosgw-admin metadata 命令设置bucket metadata 的方法
问题现象: 最近在研究zonegroup的配置操作,发现在配置zonegroup后修改了default zone,导致访问对象报404错误. 问题原因: rgw 日志 报异常'request fo ...
随机推荐
- MQ的订阅模式
一:介绍 1.模式 2.使用场景 一个生产者,多个消费者 每一个消费者都有自己的队列 生产者没有直接把消息发送给队列,而是发送到了交换机 每一个队列都要绑定到交换机 可以实现一个消息被多个消费者消费. ...
- 关于final中的几个忽略的点的再次阐述
final : 最终.作为一个修饰符,可以感性的认识,但是总是在背后会忽略特殊的角落. 1,可以修饰类,函数,变量. 2,被final修饰的类不可以被继承.为了避免被继承,被子类复写功能. 这一个点容 ...
- 000 Python的运行
1.在命令行中运行 2.使用shell(IDLE) 3.新建.py脚本 只要是编辑器都可以 4.然后脚本在IDLE中运行 首先,需要先打开IDLE,然后使用File下面的open打开所需要的py文件, ...
- Pathon1 - 基础1
一. Hello world程序 print("Hello World!") 执行命令: python hello.py ,输出 执行 python hello.py 时,明确的指 ...
- Laravel 核心概念
工欲善其事,必先利其器.在开发Xblog的过程中,稍微领悟了一点Laravel的思想.确实如此,这篇文章读完你可能并不能从无到有写出一个博客,但知道Laravel的核心概念之后,当你再次写起Larav ...
- hdu 4738 Caocao's Bridges 求无向图的桥【Tarjan】
<题目链接> 题目大意: 曹操在长江上建立了一些点,点之间有一些边连着.如果这些点构成的无向图变成了连通图,那么曹操就无敌了.周瑜为了防止曹操变得无敌,就打算去摧毁连接曹操的点的桥.但是诸 ...
- 不一样的go语言之入门篇-Hello World
这是<不一样的go语言>的开篇之作,我尝试以java语言转变者的角度来聊一聊go语言.所以今天先从go语言的基础开始,即语法. 学习一门新的编程语言,必从语法开始.但需要注意的是, ...
- 基本功 | Litho的使用及原理剖析
1. 什么是Litho? Litho是Facebook推出的一套高效构建Android UI的声明式框架,主要目的是提升RecyclerView复杂列表的滑动性能和降低内存占用.下面是Litho官网的 ...
- PHP Web项目开发学习,经验谈
列个表格吧,看着也比较方便: 时间 事项 六月 七月 八月 九月 工作任务 前端页面 服务端页面 地图定位 服务器搭建 图片上传 视频文件信息的获取 关键词 Css+div+js PHP,谷歌maps ...
- git 修改文件内容
在安装Git和创建版本库的时候,我们已经成功地添加并提交了一个readme.txt文件,现在,是时候继续工作了,于是,我们继续修改readme.txt文件,改成如下内容 [root@node1 gi ...