Home > Net >  Is there solution for viewing chunks distribution in ceph's pools with erasure code?
Is there solution for viewing chunks distribution in ceph's pools with erasure code?

Time:10-13

According to the picture from this page ceph splits objects on chunks and writes them on osds.

data chunk distribution on osd

For viewing objects distribution with replication algorithm I can use commands like ceph pg dump or ceph osd map. But I can't find commands to view data chunk distribution.

CodePudding user response:

You can use the ceph-objectstore-tool to query offline OSDs and see which OSD contains which data chunk:

[ceph: root@pacific /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-1/ --op list 
["11.2s2",{"oid":"file","key":"","snapid":-2,"hash":779072666,"max":0,"pool":11,"namespace":"","shard_id":2,"max":0}]

The first entry contains the shard ID: "11.2s2". So the PG is 11.2 and shard ID is 2. To query a cephadm deployed OSD you need to stop it via cephadm and then enter the container:

pacific:~ # cephadm unit stop --name osd.1
Inferring fsid 0a8034bc-15f4-11ec-8330-fa163eed040c
pacific:~ # cephadm shell --name osd.1
  • Related