How to do it...

Let's run through some example uses for the ceph-objectstore-tool:

  1. Find incomplete PGs on your Ceph cluster. Using this command, you can get the PG ID and its acting set:
        # ceph health detail | grep incomplete
  1. Using the acting set, you can locate the OSD host:
        # ceph osd find <osd_number>
  1. Log in to the OSD node and stop the OSD that you intend to work on:
         # systemctl stop ceph-osd@<id>

The following sections describe the OSD and placement group functions that you can use with the ceph-objectstore-tool:

  1. To identify the objects within an OSD, execute the following. The tool will output all objects, irrespective of their placement groups:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --op list
  1. To identify the objects within a placement group, execute the following:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pgid> --op list
  1. To list the placement groups stored on an OSD, execute the following:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --op list-pgs
  1. If you know the object ID that you are looking for, specify it to find the PG ID:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --op list <object-id>
  1. Retrieve information about a particular placement group:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pg-id> --op info
  1. Retrieve a log of operations on a placement group:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pg-id> --op log

Removing a placement group is a risky operation and may cause data loss; use this feature with caution. If you have a corrupt placement group on an OSD that prevents the peering or starting of the OSD service, before removing the placement group, ensure that you have a valid copy of the placement group on another OSD. As a precaution, before removing the PG, you can also take a backup of the PG by exporting it to a file:

  1. To remove a placement group, execute the following command:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pg-id> --op remove
  1. To export a placement group to a file, execute the following:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pg-id>
--file /path/to/file --op export
  1. To import a placement group from a file, execute the following:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --file </path/to/file>
--op import
  1. An OSD may have objects marked as lost. To list the lost or unfound objects, execute the following:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --op list-lost
  1. To find objects marked as lost for a single placement group, specify pgid:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pgid> --op list-lost
  1. 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:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --op fix-lost
  1. To fix lost objects for a particular placement group, specify pgid:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --pgid <pg-id> --op fix-lost
  1. If you know the identity of the lost object you want to fix, specify the object ID:
        # ceph-objectstore-tool --data-path </path/to/osd> 
--journal-path </path/to/journal> --op fix-lost <object-id>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset