让我们来看看 ceph-objectstore-tool 的一些使用示例:
- Find incomplete PGs on your Ceph cluster. Using this command, you can get the PG ID and its acting set:
- Using the acting set, you can locate the OSD host:
- Log in to the OSD node and stop the OSD that you intend to work on:
以下部分描述了您可以与 ceph-objectstore-tool:
- To identify the objects within an OSD, execute the following. The tool will output all objects, irrespective of their placement groups:
- To identify the objects within a placement group, execute the following:
- To list the placement groups stored on an OSD, execute the following:
- If you know the object ID that you are looking for, specify it to find the PG ID:
- Retrieve information about a particular placement group:
- Retrieve a log of operations on a placement group:
移除一个归置组是一个有风险的操作,可能会导致数据丢失;请谨慎使用此功能。如果您在 OSD 上有一个损坏的归置组,阻止了 OSD 服务的对等或启动,那么在删除该归置组之前,请确保您在另一个 OSD 上拥有该归置组的有效副本。作为预防措施,在删除 PG 之前,您还可以通过将 PG 导出到文件来对其进行备份:
- To remove a placement group, execute the following command:
- To export a placement group to a file, execute the following:
- To import a placement group from a file, execute the following:
- An OSD may have objects marked as lost. To list the lost or unfound objects, execute the following:
- To find objects marked as lost for a single placement group, specify pgid:
- The ceph-objectstore-tool is purposely used to fix the PG's lost objects. An OSD may have objects marked lost. To remove the lost setting for the lost objects of a placement group, execute the following:
- To fix lost objects for a particular placement group, specify pgid:
- If you know the identity of the lost object you want to fix, specify the object ID: