ivanjobs.github.io - Object Locator (Ceph) 探究笔记









Search Preview

Object Locator (Ceph) 探究笔记 | Ivan的博客

ivanjobs.github.io
Object Locator是ceph里的一个概念,有两个地方能够看到。一个是源码中,另外一个是ceph的命令行中。 今天我们简单的研究一下object locator。
.io > ivanjobs.github.io

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Object Locator (Ceph) 探究笔记 | Ivan的博客
Text / HTML ratio 37 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud test demo > obj1 Ceph rados pool rwrr object Feb 'test' ceph pg ls p0 e31 acting osd osdmap locator
Keywords consistency
Keyword Content Title Description Headings
test 22
demo 20
> 19
obj1 17
Ceph 15
rados 14
Headings
H1 H2 H3 H4 H5 H6
1 0 1 0 0 0
Images We found 1 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
test 22 1.10 %
demo 20 1.00 %
> 19 0.95 %
obj1 17 0.85 %
Ceph 15 0.75 %
rados 14 0.70 %
pool 12 0.60 %
rwrr 10 0.50 %
object 10 0.50 %
Feb 10 0.50 %
'test' 9 0.45 %
ceph 9 0.45 %
pg 9 0.45 %
ls 8 0.40 %
p0 8 0.40 %
e31 8 0.40 %
acting 8 0.40 %
osd 8 0.40 %
osdmap 8 0.40 %
locator 7 0.35 %

SEO Keywords (Two Word)

Keyword Occurrence Density
p test 13 0.65 %
rwrr 1 10 0.50 %
1 demo 10 0.50 %
demo demo 10 0.50 %
pool 'test' 9 0.45 %
e31 pool 8 0.40 %
osdmap e31 8 0.40 %
> pg 8 0.40 %
ceph osd 8 0.40 %
'test' 13 8 0.40 %
13 object 8 0.40 %
> up 8 0.40 %
map test 7 0.35 %
osd map 7 0.35 %
ls p 6 0.30 %
rados ls 6 0.30 %
rados put 5 0.25 %
Feb 9 5 0.25 %
Feb 8 5 0.25 %
demo Feb 5 0.25 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
rwrr 1 demo 10 0.50 % No
1 demo demo 10 0.50 % No
osdmap e31 pool 8 0.40 % No
e31 pool 'test' 8 0.40 % No
pool 'test' 13 8 0.40 % No
'test' 13 object 8 0.40 % No
osd map test 7 0.35 % No
ceph osd map 7 0.35 % No
ls p test 6 0.30 % No
rados ls p 6 0.30 % No
demo demo Feb 5 0.25 % No
demo Feb 8 5 0.25 % No
Feb 8 2207 4 0.20 % No
> up p0 4 0.20 % No
p0 acting p0 4 0.20 % No
up p0 acting 4 0.20 % No
p test rados 4 0.20 % No
locator1 p test 4 0.20 % No
object_locator locator1 p 4 0.20 % No
demo 18 Feb 3 0.15 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
rwrr 1 demo demo 10 0.50 % No
pool 'test' 13 object 8 0.40 % No
e31 pool 'test' 13 8 0.40 % No
osdmap e31 pool 'test' 8 0.40 % No
ceph osd map test 7 0.35 % No
rados ls p test 6 0.30 % No
demo demo Feb 8 5 0.25 % No
1 demo demo Feb 5 0.25 % No
object_locator locator1 p test 4 0.20 % No
up p0 acting p0 4 0.20 % No
demo Feb 8 2207 4 0.20 % No
> up p0 acting 4 0.20 % No
1 demo demo 18 3 0.15 % No
locator1 p test rados 3 0.15 % No
p test rados ls 3 0.15 % No
up p1 acting p1 3 0.15 % No
test rados ls p 3 0.15 % No
ls p test obj1 locator1 3 0.15 % No
> up p1 acting 3 0.15 % No
demo demo 18 Feb 3 0.15 % No

Internal links in - ivanjobs.github.io

开始使用gtest
开始使用gtest | Ivan的博客
寻找正确的语义[比赛总结]
寻找正确的语义[比赛总结] | Ivan的博客
score_thresholder服务开发总结
score_thresholder服务开发总结 | Ivan的博客
Debug CPP Program On Ubuntu
Debug CPP Program On Ubuntu | Ivan的博客
Modern CPP Developer Need To Know
Modern CPP Developer Need To Know | Ivan的博客
汇编语言学习笔记
汇编语言学习笔记 | Ivan的博客
Mesos Quota 和 Reservation
Mesos Quota 和 Reservation | Ivan的博客
libprocess学习笔记
libprocess学习笔记 | Ivan的博客
Consul使用笔记
Consul使用笔记 | Ivan的博客
SSH重新学习
SSH重新学习 | Ivan的博客
Protocol buffers 代码入门
Protocol buffers 代码入门 | Ivan的博客
Mesos Slave 如何上报资源?
Mesos Slave 如何上报资源? | Ivan的博客
Object Locator (Ceph) 探究笔记
Object Locator (Ceph) 探究笔记 | Ivan的博客
librados接口使用
librados接口使用 | Ivan的博客
Ceph RGW Pools 浅析
Ceph RGW Pools 浅析 | Ivan的博客
在单机上搭建多Ceph集群
在单机上搭建多Ceph集群 | Ivan的博客
Dockerfile中RUN/CMD/ENTRYPOINT的区分
Dockerfile中RUN/CMD/ENTRYPOINT的区分 | Ivan的博客
strace使用入门
strace使用入门 | Ivan的博客
Haystack论文学习笔记
Haystack论文学习笔记 | Ivan的博客
Mesos关联配置
Mesos关联配置 | Ivan的博客
ZooKeeper概览
ZooKeeper概览 | Ivan的博客
Ceph故障解析-filestore_merge_threshold
Ceph故障解析-filestore_merge_threshold | Ivan的博客
基于laravel+mysql的容器化DAL方案
基于laravel+mysql的容器化DAL方案 | Ivan的博客
vuejs使用小结1
vuejs使用小结1 | Ivan的博客
Ceph新技能Get
Ceph新技能Get | Ivan的博客
Ceph v10.2.3 RGW源码解析2
Ceph v10.2.3 RGW源码解析2 | Ivan的博客
Ceph v10.2.3 RGW源码解析1
Ceph v10.2.3 RGW源码解析1 | Ivan的博客
s3cmd使用说明
s3cmd使用说明 | Ivan的博客
vuejs工具链简介
vuejs工具链简介 | Ivan的博客
requirejs简介
requirejs简介 | Ivan的博客
可编程自动化输入方案(Mac下)
可编程自动化输入方案(Mac下) | Ivan的博客
Mesos Supress/Revive Offers测试
Mesos Supress/Revive Offers测试 | Ivan的博客
Mesos Offer生命周期杂记
Mesos Offer生命周期杂记 | Ivan的博客
Mesos Agent Containerizer分析
Mesos Agent Containerizer分析 | Ivan的博客
get started with createjs chapter 1 notes
get started with createjs chapter 1 notes | Ivan的博客
mesos agent /monitor/statistics返回数据业务意义
mesos agent /monitor/statistics返回数据业务意义 | Ivan的博客
mesos master/messages_deactivate_frameworks 不生效?
mesos master/messages_deactivate_frameworks 不生效? | Ivan的博客
KMP算法杂谈
KMP算法杂谈 | Ivan的博客
Mesos配置项深入分析
Mesos配置项深入分析 | Ivan的博客
mesos-master replicated_log存的是什么?
mesos-master replicated_log存的是什么? | Ivan的博客
mesos disk usage vs df 结果不一致问题
mesos disk usage vs df 结果不一致问题 | Ivan的博客
Mesos GC原理解析
Mesos GC原理解析 | Ivan的博客
准备mesos单机版开发测试环境
准备mesos单机版开发测试环境 | Ivan的博客
Mesos 1.0.0 源码解析杂记
Mesos 1.0.0 源码解析杂记 | Ivan的博客
stout学习笔记
stout学习笔记 | Ivan的博客
gflags学习笔记
gflags学习笔记 | Ivan的博客
ceph fuse挂载cephfs, ls不出文件列表问题,调试记录
ceph fuse挂载cephfs, ls不出文件列表问题,调试记录 | Ivan的博客
Ceph源码解析(3)-rados put过程探究
Ceph源码解析(3)-rados put过程探究 | Ivan的博客
Hub,Bridge,Switch和Gateway是什么?
Hub,Bridge,Switch和Gateway是什么? | Ivan的博客
数论学习笔记
数论学习笔记 | Ivan的博客
二分图专题解析
二分图专题解析 | Ivan的博客
Ceph Cluster调优日志
Ceph Cluster调优日志 | Ivan的博客
boost库的智能指针
boost库的智能指针 | Ivan的博客
Linux命令使用记录
Linux命令使用记录 | Ivan的博客
Vim Cheat Sheet
Vim Cheat Sheet | Ivan的博客
原码、反码、补码笔记
原码、反码、补码笔记 | Ivan的博客
ceph-deploy 配置文件比较 BUG
ceph-deploy 配置文件比较 BUG | Ivan的博客
Ceph源码解析(2)-rados put过程探究
Ceph源码解析(2)-rados put过程探究 | Ivan的博客
Ceph Release 概述
Ceph Release 概述 | Ivan的博客
Ceph CRUSH Map 维护详解
Ceph CRUSH Map 维护详解 | Ivan的博客
题解[第二周]
题解[第二周] | Ivan的博客
MathQuill Math Equation Cheatsheet
MathQuill Math Equation Cheatsheet | Ivan的博客
题解[第一周]
题解[第一周] | Ivan的博客
Ceph集群运维问题记录
Ceph集群运维问题记录 | Ivan的博客
linux man高级技巧
linux man高级技巧 | Ivan的博客
Git 我错了!
Git 我错了! | Ivan的博客
Ceph源码解析(1)-Create Pool过程探究
Ceph源码解析(1)-Create Pool过程探究 | Ivan的博客
准备Ceph开发环境
准备Ceph开发环境 | Ivan的博客
Ceph:Too Many PGs Per OSD
Ceph:Too Many PGs Per OSD | Ivan的博客
UVA 11292 题解
UVA 11292 题解 | Ivan的博客
Ceph RBD 文件映射实验笔记
Ceph RBD 文件映射实验笔记 | Ivan的博客
硬盘分区
硬盘分区 | Ivan的博客
硬盘模型
硬盘模型 | Ivan的博客
Ceph配置项
Ceph配置项 | Ivan的博客
OSTEP 文件系统实现
OSTEP 文件系统实现 | Ivan的博客
在Ceph底层xfs上找到你上传的文件
在Ceph底层xfs上找到你上传的文件 | Ivan的博客
使用s3cmd操作ceph rgw
使用s3cmd操作ceph rgw | Ivan的博客
Ceph核心概念备忘录
Ceph核心概念备忘录 | Ivan的博客
COSBench使用笔记
COSBench使用笔记 | Ivan的博客
使用saltstack部署运维ceph集群笔记
使用saltstack部署运维ceph集群笔记 | Ivan的博客
如何使用salt states?
如何使用salt states? | Ivan的博客
ceph-deploy命令详解
ceph-deploy命令详解 | Ivan的博客
dd笔记
dd笔记 | Ivan的博客
DTrace是什么?
DTrace是什么? | Ivan的博客
Ceph Cache Tier笔记
Ceph Cache Tier笔记 | Ivan的博客
Linux下理解filesystem/device/mount等概念
Linux下理解filesystem/device/mount等概念 | Ivan的博客
Base64编码详解与应用
Base64编码详解与应用 | Ivan的博客
URLEncoder学习笔记
URLEncoder学习笔记 | Ivan的博客
Ceph论文阅读笔记
Ceph论文阅读笔记 | Ivan的博客
使用Python inotify监控文件变化
使用Python inotify监控文件变化 | Ivan的博客
Git命令Snippets
Git命令Snippets | Ivan的博客

Ivanjobs.github.io Spined HTML


Object Locator (Ceph) 探究笔记 | Ivan的博客 最新文章 dev ops math algorithm personal 开始使用gtest 2018书单课单 2017年总结/2018年展望 寻找正确的语义[比赛总结] score_thresholder服务开发总结 Debug CPP Program On Ubuntu Modern CPP Developer Need To Know 汇编语言学习笔记 Mesos Quota 和 Reservation libprocess学习笔记 Consul使用笔记 SSH重新学习 Protocol buffers 代码入门 Mesos Slave 如何上报资源? Object Locator (Ceph) 探究笔记 librados接口使用 Ceph RGW Pools 浅析 在单机上搭建多Ceph集群 2016年总结/2017年展望 Dockerfile中RUN/CMD/ENTRYPOINT的区分 strace使用入门 Haystack论文学习笔记 Mesos关联配置 ZooKeeper概览 Ceph故障解析-filestore_merge_threshold 基于laravel+mysql的容器化DAL方案 vuejs使用小结1 Ceph新技能Get Ceph v10.2.3 RGW源码解析2 Ceph v10.2.3 RGW源码解析1 s3cmd使用说明 vuejs工具链简介 requirejs简介 mesos maintenance深度解析 可编程自动化输入方案(Mac下) Mesos Supress/Revive Offers测试 Mesos Offer生命周期杂记 MesosWage-earnerContainerizer分析 get started with createjs installment 1 notes mesos wage-earner /monitor/statistics返回数据业务意义 mesos master/messages_deactivate_frameworks 不生效? mesos /flags 403 forbidden? KMP算法杂谈 Mesos配置项深入分析 mesos-master replicated_log存的是什么? mesos disk usage vs df 结果不一致问题 Mesos GC原理解析 准备mesos单机版开发测试环境 Mesos 1.0.0 源码解析杂记 stout学习笔记 gflags学习笔记 ceph fuse挂载cephfs, ls不出文件列表问题,调试记录 Ceph源码解析(3)-rados put过程探究 Hub,Bridge,Switch和Gateway是什么? 数论学习笔记 二分图专题解析 Ceph Cluster调优日志 boost库的智能指针 Linux命令使用记录 Vim Cheat Sheet 原码、反码、补码笔记 ceph-deploy 配置文件比较 BUG Ceph源码解析(2)-rados put过程探究 Ceph Release 概述 Ceph CRUSH Map 维护详解 题解[第二周] MathQuill Math Equation Cheatsheet 题解[第一周] Ceph集群运维问题记录 linux man高级技巧 Git 我错了! Ceph源码解析(1)-Create Pool过程探究 准备Ceph开发环境 Ceph:Too Many PGs Per OSD UVA 11292 题解 Docker Private Registry(Ceph Swift) 搭建笔记 Ceph RBD 文件映射实验笔记 硬盘分区 硬盘模型 Ceph配置项 OSTEP 文件系统实现 在Ceph底层xfs上找到你上传的文件 使用s3cmd操作ceph rgw Ceph核心概念备忘录 COSBench使用笔记 GCJ2015 Qualification Round-B题解 使用saltstack部署运维ceph集群笔记 如何使用salt states? ceph-deploy命令详解 dd笔记 DTrace是什么? Ceph Cache Tier笔记 Linux下理解filesystem/device/mount等概念 Base64编码详解与应用 URLEncoder学习笔记 Ceph论文阅读笔记 使用Python inotify监控文件变化 Git命令Snippets 使用Nginx做LB MathQuill学习笔记 Docker化Laravel开发环境 Ceph Pool PG配置说明 Ceph 笔记 Ceph源码分析 Latex数学符号 为Ceph OSS服务搭建LB Ceph RGW S3接口测试:诡异的403 AccessDenied问题 访问Ceph RGW失败 403 Forbidden问题 解决历程 Ceph RADOS论文研读笔记 Ceph源码分析:从一个REST请求,到OSD存储。 各种开源代码协议简述 OpenStack Projects简述 OpenStack Ceilometer 笔记 RabbitMQ 和 oslo.messaging Ceph Rest API 身份验证方式(S3) tcpdump笔记 Ceph集群部署笔记 Python PEP8规范笔记 Python Decorator(装饰器)模式 笔记 libvirt笔记 OpenStack oslo 概览 OpenStack KeyStone API http://localhost:5000/ 源码追踪 Python pdb笔记 zero length variety in a struct Jenkins' Hash Functions NTP部署笔记 Linux iptables笔记 Python Paste笔记 Python PasteDeploy笔记 Python eventlet笔记 使用curl测试RESTful接口 ubuntu14.04下安装devstack devstack 安装指南【最简单】 Docker操作记录 git merge 详解 Python 包管理详解 阿里云服务器设置swapfile的方法 shell脚本编写向导 搭建Laravel全栈开发环境 2017 February 09 Object Locator (Ceph) 探究笔记 Object Locator是ceph里的一个概念,有两个地方能够看到。一个是源码中,另外一个是ceph的命令行中。 今天我们简单的研究一下object locator。 对Object Locator描述最详细的地方,是在librados的api文档中: The key is used instead of the object name to determine which placement groups an object is put in. This affects all subsequent operations of the io context - until a variegated locator key is set, all objects in this io context will be placed in the same pg. 通过理解上面引用的文字,我们大概知道,在一个IO Context中,Object Locator可以实现将多个object映射到同一个pg中。 下面我就验证一下。 ./ceph osd pool create test 128 pool 'test' created ./rados ls -p test reverberate "hello" > /tmp/hello ./rados put obj1 /tmp/hello --object_locator locator1 -p test ./rados ls -p test obj1 locator1 obj1 我们发现,test里有两个obj1, 一个有object locator, 一个是没有object locator。 让人感到意外的是,他们两个可以使用相同的object key即obj1。 下面,我们看看,这两个相同key的obj,内容是否可以不一样: reverberate "obj1 with locator" > /tmp/obj1_with_locator reverberate "obj1 without locator" > /tmp/obj1_without_locator ./rados put obj1 /tmp/obj1_with_locator --object_locator locator1 -p test ./rados put obj1 /tmp/obj1_without_locator -p test ./rados ls -p test obj1 locator1 obj1 ./rados get obj1 /tmp/out1_with_locator --object_locator locator1 -p test cat /tmp/out1_with_locator obj1 with locator ./rados get obj1 /tmp/out1_without_locator -p test cat /tmp/out1_without_locator obj1 without locator 由此可见,带locator的obj和不带locator的obj可以重名。 下面我们验证,使用同一个locator的多个obj,是否在同一个pg中: ./rados put obj2 /tmp/obj1_with_locator --object_locator locator1 -p test ./rados ls -p test obj1 locator1 obj2 locator1 obj1 到这里,我们就有了两个都带locator=locator1的对象obj1和obj2。 下面我们看,这两个obj是否在同一个pg中: ./ceph osd map test obj1 osdmap e31 pool 'test' (13) object 'obj1' -> pg 13.6cf8deff (13.7f) -> up ([0,2,1], p0) vicarial ([0,2,1], p0) ./ceph osd map test obj1 locator1 osdmap e31 pool 'test' (13) object 'locator1/obj1' -> pg 13.6c816c50 (13.50) -> up ([1,0,2], p1) vicarial ([1,0,2], p1) 很神奇,第二个命令,使用locator作为namespace。 在librados的api中,也可以设置IO Context的namespace,待研究。 ./ceph osd map test obj2 locator1 osdmap e31 pool 'test' (13) object 'locator1/obj2' -> pg 13.eb28cc88 (13.8) -> up ([2,0,1], p2) vicarial ([2,0,1], p2) 我们意外的发现,同一个locator下的两个对象,竟然不在一个pg上。 原因是什么?我们根本就不在一个IO Context里,所以就不可能在一个PG上。 那么我们如何put两个obj,使用同一个IO Context? 基于librados接口,写一段测试代码: 参考资料在这里。 发现找不到rados包,参考这里,没有得到解决。 最后使用: sudo apt-get install python-ceph 得到解决。 import rados cluster = rados.Rados(conffile='ceph.conf') print cluster.version() cluster.connect() print cluster.get_fsid() print '\n>>>>>>>>>>>list pools............' pools = cluster.list_pools() for pool in pools: print pool ioctx = cluster.open_ioctx('test') ioctx.set_locator_key('fool_locator') ioctx.write_full('k1', 'k1 content') ioctx.write_full('k2', 'k2 content') ioctx.close() 0.69.0 5c23f497-6e0f-474f-b614-02ced0551d81 >>>>>>>>>>>list pools............ rbd cephfs_data_a cephfs_metadata_a .rgw.root default.rgw.control default.rgw.data.root default.rgw.gc default.rgw.log default.rgw.users.uid default.rgw.users.email default.rgw.users.keys default.rgw.meta default.rgw.users.swift test 期望中,k1和k2的locator为“fool_locator”, 并且在同一个pg里, 我们来看一看,是不是这样: ./rados ls -p test c1 k1 fool_locator k2 fool_locator obj1 locator1 obj2 locator1 c1 locator2 obj1 ./ceph osd map test fool_locator osdmap e31 pool 'test' (13) object 'fool_locator' -> pg 13.e13235ea (13.6a) -> up ([0,1,2], p0) vicarial ([0,1,2], p0) ./ceph osd map test c1 osdmap e31 pool 'test' (13) object 'c1' -> pg 13.7f8a09ea (13.6a) -> up ([0,1,2], p0) vicarial ([0,1,2], p0) 似乎k1和k2不在一个pg上,然而我们要知道pg查询命令只做计算,而不做校验。 所以我们必须观察实际的存储情况。 ls -l ./dev/osd0/current/13.6a_head total 20 -rw-r--r-- 1 demo demo 0 Feb 8 22:07 __head_0000006A__d -rw-r--r-- 1 demo demo 0 Feb 8 22:59 c1__head_7F8A09EA__d -rw-r--r-- 1 demo demo 10 Feb 9 00:16 k1_fool\ulocator_head_E13235EA__d -rw-r--r-- 1 demo demo 10 Feb 9 00:16 k2_fool\ulocator_head_E13235EA__d 似乎使用了locator,在做pg映射时obj key就不参与映射计算了。 我们再测试一次: ./rados put k3 /tmp/obj1_with_locator -p test --object_locator fool_again ./rados ls -p test k3 fool_again c1 k1 fool_locator k2 fool_locator obj1 locator1 obj2 locator1 c1 locator2 obj1 ./ceph osd map test k3 osdmap e31 pool 'test' (13) object 'k3' -> pg 13.d140550 (13.50) -> up ([1,0,2], p1) vicarial ([1,0,2], p1) ls -l ./dev/osd0/current/13.50_head total 0 -rw-r--r-- 1 demo demo 0 Feb 8 22:07 __head_00000050__d ./ceph osd map test fool_again osdmap e31 pool 'test' (13) object 'fool_again' -> pg 13.4260301e (13.1e) -> up ([0,2,1], p0) vicarial ([0,2,1], p0) total 8 -rw-r--r-- 1 demo demo 0 Feb 8 22:07 __head_0000001E__d -rw-r--r-- 1 demo demo 18 Feb 9 08:40 k3_fool\uagain_head_4260301E__d obj1 with locator 由上面的测试,再次确认:当使用locator的时候,pg映射仅仅跟locator相关。 还有一个疑问,使用rados命令到底能不能把两个obj放到一个pg上? osdmap e31 pool 'test' (13) object 'same_pg' -> pg 13.93ca2ecd (13.4d) -> up ([1,0,2], p1) vicarial ([1,0,2], p1) total 16 -rw-r--r-- 1 demo demo 0 Feb 8 22:07 __head_0000004D__d -rw-r--r-- 1 demo demo 18 Feb 9 08:46 same\upg\uobj1_same\upg_head_93CA2ECD__d -rw-r--r-- 1 demo demo 18 Feb 9 08:47 same\upg\uobj2_same\upg_head_93CA2ECD__d 得证,使用rados命令同样有效! 总结 Object Locator可以将多个obj,映射到同一个pg上:实现方法是obj key不参与运算,locator参与pg映射运算。 待研究:namespace。 Please enable JavaScript to view the comments powered by Disqus. All content is licensed under CC BY-NC-SA Buit with Jekyll and 3-Jekyll theme • Hosted on Github Table of Contents