CEPH作为对象存储时, 例如用于Openstack的对象存储. 如何查找对象在ceph的位置?
首选, 我们看看如何将数据作为对象存储到ceph : 
1. 需要选择一个池
2. 需要指定对象名
例如我把test.img放到ceph的pool1这个池.

[root@localhost rbd0]# ceph osd lspools
0 rbd,1 pool1,
[root@localhost rbd0]# rados lspools
rbd
pool1
[root@localhost rbd0]# ll
total 1024000
-rw-r--r-- 1 root root 1048576000 Dec 25 01:43 test.img

使用rados把这个文件放到pool1池, 对象名设置为test.img.digoal.

[root@localhost rbd0]# rados put test.img.digoal ./test.img --pool=pool1

查看池中的对象

[root@localhost rbd0]# rados ls --pool=pool1|grep test
test.img.digoal

查找对象在ceph集群的位置

[root@localhost rbd0]# ceph osd map pool1 test.img.digoal
osdmap e62 pool 'pool1' (1) object 'test.img.digoal' -> pg 1.79035c22 (1.22) -> up ([3,0], p3) acting ([3,0], p3)

导出对象

[root@localhost rbd0]# rm -f test.img
[root@localhost rbd0]# rados get test.img.digoal ./test.img --pool=pool1
[root@localhost rbd0]# ll
total 1024000
-rw-r--r-- 1 root root 1048576000 Dec 25 18:19 test.img

查看对象的信息

[root@localhost rbd0]# rados stat test.img.digoal --pool=pool1
pool1/test.img.digoal mtime 1419502604, size 1048576000

删除对象

[root@localhost rbd0]# rados rm test.img.digoal --pool=pool1

[参考]

1.

[root@localhost rbd0]# rados --help
usage: rados [options] [commands]
POOL COMMANDSlspools                          list poolsmkpool <pool-name> [123[ 4]]     create pool <pool-name>'[with auid 123[and using crush rule 4]]cppool <pool-name> <dest-pool>   copy content of a poolrmpool <pool-name> [<pool-name> --yes-i-really-really-mean-it]remove pool <pool-name>'df                               show per-pool and total usagels                               list objects in poolchown 123                        change the pool owner to auid 123OBJECT COMMANDSget <obj-name> [outfile]         fetch objectput <obj-name> [infile]          write objecttruncate <obj-name> length       truncate objectcreate <obj-name> [category]     create objectrm <obj-name> ...                remove object(s)cp <obj-name> [target-obj]       copy objectclonedata <src-obj> <dst-obj>    clone object datalistxattr <obj-name>getxattr <obj-name> attrsetxattr <obj-name> attr valrmxattr <obj-name> attrstat objname                     stat the named objectmapext <obj-name>lssnap                           list snapsmksnap <snap-name>               create snap <snap-name>rmsnap <snap-name>               remove snap <snap-name>rollback <obj-name> <snap-name>  roll back object to snap <snap-name>listsnaps <obj-name>             list the snapshots of this objectbench <seconds> write|seq|rand [-t concurrent_operations] [--no-cleanup] [--run-name run_name]default is 16 concurrent IOs and 4 MB opsdefault is to clean up after write benchmarkdefault run-name is 'benchmark_last_metadata'cleanup [--run-name run_name] [--prefix prefix]clean up a previous benchmark operationdefault run-name is 'benchmark_last_metadata'load-gen [options]               generate load on the clusterlistomapkeys <obj-name>          list the keys in the object maplistomapvals <obj-name>          list the keys and vals in the object map getomapval <obj-name> <key> [file] show the value for the specified keyin the object's object mapsetomapval <obj-name> <key> <val>rmomapkey <obj-name> <key>getomapheader <obj-name> [file]setomapheader <obj-name> <val>tmap-to-omap <obj-name>          convert tmap keys/values to omaplistwatchers <obj-name>          list the watchers of this objectset-alloc-hint <obj-name> <expected-object-size> <expected-write-size>set allocation hint for an objectIMPORT AND EXPORTimport [options] <local-directory> <rados-pool>Upload <local-directory> to <rados-pool>export [options] <rados-pool> <local-directory>Download <rados-pool> to <local-directory>options:-f / --force                 Copy everything, even if it hasn't changed.-d / --delete-after          After synchronizing, delete unreferencedfiles or objects from the target bucketor directory.--workers                    Number of worker threads to spawn (default 5)ADVISORY LOCKSlock list <obj-name>List all advisory locks on an objectlock get <obj-name> <lock-name>Try to acquire a locklock break <obj-name> <lock-name> <locker-name>Try to break a lock acquired by another clientlock info <obj-name> <lock-name>Show lock informationoptions:--lock-tag                   Lock tag, all locks operation should usethe same tag--lock-cookie                Locker cookie--lock-description           Description of lock--lock-duration              Lock duration (in seconds)--lock-type                  Lock type (shared, exclusive)CACHE POOLS: (for testing/development only)cache-flush <obj-name>           flush cache pool object (blocking)cache-try-flush <obj-name>       flush cache pool object (non-blocking)cache-evict <obj-name>           evict cache pool objectcache-flush-evict-all            flush+evict all objectscache-try-flush-evict-all        try-flush+evict all objectsGLOBAL OPTIONS:--object_locator object_locatorset object_locator for operation-p pool--pool=poolselect given pool by name--target-pool=poolselect target pool by name-b op_sizeset the size of write ops for put or benchmarking-s name--snap nameselect given snap name for (read) IO-i infile--createcreate the pool or directory that was specified-N namespace--namespace=namespacespecify the namespace to use for the objectBENCH OPTIONS:-t N--concurrent-ios=NSet number of concurrent I/O operations--show-timeprefix output with date/timeLOAD GEN OPTIONS:--num-objects                    total number of objects--min-object-size                min object size--max-object-size                max object size--min-ops                        min number of operations--max-ops                        max number of operations--max-backlog                    max backlog (in MB)--percent                        percent of operations that are read--target-throughput              target throughput (in MB)--run-length                     total time (in seconds)

2. http://ceph.com/docs/master/rados/operations/monitoring-osd-pg/

To store object data in the Ceph Object Store, a Ceph client must:
1. Set an object name
2. Specify a poolThe Ceph client retrieves the latest cluster map and the CRUSH algorithm calculates how to map the object to a placement group, and then calculates how to assign the placement group to an OSD dynamically. To find the object location, all you need is the object name and the pool name. For example:ceph osd map {poolname} {object-name}
Exercise: Locate an ObjectAs an exercise, lets create an object. Specify an object name, a path to a test file containing some object data and a pool name using the rados put command on the command line. For example:rados put {object-name} {file-path} --pool=data
rados put test-object-1 testfile.txt --pool=data
To verify that the Ceph Object Store stored the object, execute the following:rados -p data ls
Now, identify the object location:ceph osd map {pool-name} {object-name}
ceph osd map data test-object-1
Ceph should output the object’s location. For example:osdmap e537 pool 'data' (0) object 'test-object-1' -> pg 0.d1743484 (0.4) -> up [1,0] acting [1,0]
To remove the test object, simply delete it using the rados rm command. For example:rados rm test-object-1 --pool=data
As the cluster evolves, the object location may change dynamically. One benefit of Ceph’s dynamic rebalancing is that Ceph relieves you from having to perform the migration manually. See the Architecture section for details.

Ceph FINDING AN OBJECT LOCATION相关推荐

  1. ceph (cephadm)集群部署

    ceph 集群部署(cephadm) 方法1: (ansible) ceph-ansible使用Ansible部署和管理Ceph集群. (1)ceph-ansible被广泛部署. (2)ceph-an ...

  2. 分布式存储系统 Ceph 介绍与环境部署

    文章目录 一.概述 二.Ceph 架构 三.Ceph核心组件介绍 四.Ceph 三种存储类型 1)块存储服务(RBD) 2)文件系统存储服务(CephFS) 3)对象存储服务(RGW) 五.Ceph版 ...

  3. 【论文总结】Few-shot Object Detection via Feature Reweighting(附翻译)

    Few-shot Object Detection via Feature Reweighting基于特征重加权的小样本目标检测 论文地址:https://arxiv.org/abs/1812.018 ...

  4. 【CV-Paper 14】Selective Search for Object Recognition

    论文原文:LINK 论文年份:2013 论文被引:4498(2020/07/09) 6221(2022/03/26) 文章目录 Selective Search for Object Recognit ...

  5. Ceph分布式存储高性能设计

    随着数据量的不断增长,如何以高效的方式存储数据量成为IT界的一个挑战.许多传统存储解决方案不能满足日益增长的需求,业界迫切需要一种新的方法来管理现今的数据,为用户控制访问时间,缩减管理成本. 软件定义 ...

  6. 图像理解之物体检测object detection,模型rcnn/fastrcnn/fasterrcnn原理及概念

    A,https://www.cnblogs.com/zhengzhe/p/7783270.html RCNN选择性搜索(Selective Search) RCNN选择性搜索(Selective Se ...

  7. ceph 面试_终于有人把Ceph分布式存储讲清楚了!

    Ceph项目最早起源于Sage就读博士期间的工作(最早的成果于2004年发表),并随后贡献给开源社区.在经过了数年的发展之后,目前已得到众多云计算厂商的支持并被广泛应用.RedHat及OpenStac ...

  8. 部署Ceph分布式高可用集群中篇

    前言 如何快速部署Ceph分布式高可用集群 Ceph分布式存储底层实现原理 上文介绍了ceph的原理以及ceph的部署(部署了一个mon角色)本文继续介绍下ceph的部署 部署OSD 查看磁盘使用情况 ...

  9. 与ceph的区别_Ceph分布式存储高性能设计

    随着数据量的不断增长,如何以高效的方式存储数据量成为IT界的一个挑战.许多传统存储解决方案不能满足日益增长的需求,业界迫切需要一种新的方法来管理现今的数据,为用户控制访问时间,缩减管理成本. 软件定义 ...

最新文章

  1. python怎么发送代码文件_python 通过 socket 发送文件的实例代码
  2. 字符串转数字 sql_SQL注入·sqli-labs·基于错误的字符串/数字型注入(第1~2关)
  3. 模拟信号与离散信号之间的频率关系(由模拟信号采样得到的离散信号)
  4. 分析各种排序算法的优劣
  5. ie6 select出现在浮动层上面的解决方法
  6. 解决卸载时残留目标文件夹的问题
  7. 全国计算机等级考试题库二级C操作题100套(第03套)
  8. 1.13编程基础之综合应用_14求满足条件的3位数
  9. Windows环境下手动更新boot2docker.iso
  10. oracle 不等函数,Oracle 不常用函数
  11. 数据--第28课 - 进阶星移
  12. git最简单直接粗爆与github教程
  13. Excel图表工具——添加数据标签
  14. python爬取股票历史数据_爬取股票历史数据并绘制K线图
  15. C# Socket通信服务器编写
  16. Java音频格式转换,支持amr、aud、slk、silk转成mp3的程序
  17. 百度身份证认证一直失败
  18. vue v-model 双向绑定表单元素的数据:实质是绑定了value、checked、selected属性
  19. spring boot 使用 bboss 操作 ES
  20. 产业赋能,平台先行——未来工业强国的典型特征

热门文章

  1. 递推DP URAL 1119 Metro
  2. [安全测试报告]针对某厂商的一次渗透性测试
  3. 【观点】健康的心智是中国未来最大的生产力
  4. Android 安全架构及权限控制机制剖析
  5. Timus 1741
  6. IDEA下SSM项目搭建的基本操作
  7. js数组去重的4个方法
  8. linux 卸载、安装mysql
  9. 2012第50周星期日
  10. Joomla源代码解析(十九) JController