Ceph clients use the following steps to compute PG IDs.
- The client inputs the pool ID and the object ID. (e.g., pool = "liverpool" and object-id = "john")
- CRUSH takes the object ID and hashes it.
- CRUSH calculates the hash modulo of the number of PGs. (e.g., 58) to get a PG ID.
- CRUSH calculates the primary OSD corresponding to the PG ID.
- The client gets the pool ID given the pool name (e.g., "liverpool" = 4)
- The client prepends the pool ID to the PG ID (e.g., 4.58).
- The client performs an object operation (e.g., write, read, delete, etc.) by communicating directly with the Primary OSD in the Acting Set.
參考:https://access.redhat.com/documentation/en/red-hat-ceph-storage/1.3/architecture-guide/chapter-2-storage-cluster-architecture