Ceph OSD : Where Is My Data ?
The purpose is to verify where my data is stored on the Ceph cluster.
For this, I have just create a minimal cluster with 3 osd :
1
|
|
Where is my osd directory on ceph-01 ?
1 2 |
|
The directory content :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|
The data are store in the directory “current” : It contains some file and many _head file :
1 2 3 4 5 6 |
|
In omap directory :
1 2 3 4 5 6 7 8 |
|
In meta directory :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
Try decompiling crush map from osdmap :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
Ok it’s what I expect. :)
The cluster is empty :
1 2 |
|
The directory list correspond to the ‘ceph pg dump’
1 2 3 |
|
To get all stats for a specific pg :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
Retrieve an object on the cluster ¶
In this test we create a standard pool (pgnum=8 and repli=2)
1 2 3 4 5 6 7 8 |
|
My Ceph logo is on pg 3.2 (main on osd.2 and replica on osd.1)
1 2 3 4 5 6 7 8 9 |
|
And osd.2 is on ceph-03 :
1 2 3 4 5 |
|
It exactly the same :)
Import RBD ¶
Same thing, but testing as a block device.
1 2 3 4 5 6 7 8 |
|
Only one object.
1 2 3 4 5 6 7 |
|
Let’s go.
1 2 3 4 |
|
Here we can retrieve the block name prefix of the rbd ‘rb.0.1048.2ae8944a’ :
1 2 |
|
On ceph-03 :
1 2 3 |
|
We retrieve the file unchanged because it is not split :)
Try RBD snapshot ¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
It’s the same place on ceph-03 :
1 2 3 4 |
|
We can notice that file containing 2 (snap id 2) contain original data. And a new file has been created for the current data : head
For next tests, I will try with stripped files, rbd format 2 and snap on pool.