Object操作

创建Pool

  1. root@dev:/# ceph osd pool create web-services 128 128
  2. pool 'web-services' created
  3. root@dev:/# rados lspools
  4. rbd
  5. cephfs_data
  6. cephfs_metadata
  7. .rgw.root
  8. .rgw.control
  9. .rgw
  10. .rgw.gc
  11. .users.uid
  12. web-services

添加Object

  1. root@dev:/# echo "Hello Ceph, You are Awesome like MJ" > /tmp/helloceph
  2. root@dev:/# rados -p web-services put object1 /tmp/helloceph
  3. root@dev:/# rados -p web-services ls
  4. object1
  5. root@dev:/# ceph osd map web-services object1
  6. osdmap e29 pool 'web-services' (8) object 'object1' -> pg 8.bac5debc (8.3c) -> up ([0], p0) acting ([0], p0)

查看Object

  1. root@dev:/# cd /var/lib/ceph/osd/
  2. root@dev:/var/lib/ceph/osd# ls ceph-0/current/8.3c_head/
  3. __head_0000003C__8 object1__head_BAC5DEBC__8
  4. root@dev:/var/lib/ceph/osd# cat ceph-0/current/8.3c_head/object1__head_BAC5DEBC__8
  5. Hello Ceph, You are Awesome like MJ