Chapter 8. Troubleshooting objects
As a storage administrator, you can use the ceph-objectstore-tool utility to perform high-level or low-level object operations. The ceph-objectstore-tool utility can help you troubleshoot problems related to objects within a particular OSD or placement group.
Manipulating objects can cause unrecoverable data loss. Contact Red Hat support before using the ceph-objectstore-tool utility.
8.1. Prerequisites Copy linkLink copied to clipboard!
- Verify there are no network related issues.
8.2. Troubleshooting high-level object operations Copy linkLink copied to clipboard!
As a storage administrator, you can use the ceph-objectstore-tool utility to perform high-level object operations. The ceph-objectstore-tool utility supports the following high-level object operations:
- List objects
- List lost objects
- Fix lost objects
Manipulating objects can cause unrecoverable data loss. Contact Red Hat support before using the ceph-objectstore-tool utility.
8.2.1. Prerequisites Copy linkLink copied to clipboard!
-
Having
rootaccess to the Ceph OSD nodes.
8.2.2. Listing objects Copy linkLink copied to clipboard!
The OSD can contain zero to many placement groups, and zero to many objects within a placement group (PG). The ceph-objectstore-tool utility allows you to list objects stored within an OSD.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1Identify all the objects within an OSD, regardless of their placement group:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --op listExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op listIdentify all the objects within a placement group:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID --op listExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op listIdentify the PG an object belongs to:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --op list $OBJECT_IDExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op list default.region
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.2.3. Fixing lost objects Copy linkLink copied to clipboard!
You can use the ceph-objectstore-tool utility to list and fix lost and unfound objects stored within a Ceph OSD. This procedure applies only to legacy objects.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1To list all the lost legacy objects:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --op fix-lost --dry-runExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost --dry-runUse the
ceph-objectstore-toolutility to fix lost and unfound objects. Select the appropriate circumstance:To fix all lost objects:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --op fix-lostExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lostTo fix all the lost objects within a placement group:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID --op fix-lostExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op fix-lostTo fix a lost object by its identifier:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --op fix-lost $OBJECT_IDExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost default.region
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3. Troubleshooting low-level object operations Copy linkLink copied to clipboard!
As a storage administrator, you can use the ceph-objectstore-tool utility to perform low-level object operations. The ceph-objectstore-tool utility supports the following low-level object operations:
- Manipulate the object’s content
- Remove an object
- List the object map (OMAP)
- Manipulate the OMAP header
- Manipulate the OMAP key
- List the object’s attributes
- Manipulate the object’s attribute key
Manipulating objects can cause unrecoverable data loss. Contact Red Hat support before using the ceph-objectstore-tool utility.
8.3.1. Prerequisites Copy linkLink copied to clipboard!
-
Having
rootaccess to the Ceph OSD nodes.
8.3.2. Manipulating the object’s content Copy linkLink copied to clipboard!
With the ceph-objectstore-tool utility, you can get or set bytes on an object.
Setting the bytes on an object can cause unrecoverable data loss. To prevent data loss, make a backup copy of the object.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1- Find the object by listing the objects of the OSD or placement group (PG).
Before setting the bytes on an object, make a backup and a working copy of the object:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID \ $OBJECT \ get-bytes > $OBJECT_FILE_NAME ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID \ $OBJECT \ get-bytes > $OBJECT_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c \ '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ get-bytes > zone_info.default.backup [root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c \ '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ get-bytes > zone_info.default.working-copy- Edit the working copy object file and modify the object contents accordingly.
Set the bytes of the object:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID \ $OBJECT \ set-bytes < $OBJECT_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c \ '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ set-bytes < zone_info.default.working-copy
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3.3. Removing an object Copy linkLink copied to clipboard!
Use the ceph-objectstore-tool utility to remove an object. By removing an object, its contents and references are removed from the placement group (PG).
You cannot recreate an object once it is removed.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Remove an object:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID \ $OBJECT \ removeExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c \ '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ remove
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3.4. Listing the object map Copy linkLink copied to clipboard!
Use the ceph-objectstore-tool utility to list the contents of the object map (OMAP). The output provides you a list of keys.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1List the object map:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD --pgid $PG_ID \ $OBJECT \ list-omapExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c \ '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ list-omap
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3.5. Manipulating the object map header Copy linkLink copied to clipboard!
The ceph-objectstore-tool utility will output the object map (OMAP) header with the values associated with the object’s keys.
If using FileStore as the OSD backend object store, then add the --journal-path $PATH_TO_JOURNAL argument when getting or setting the object map header. Where the $PATH_TO_JOURNAL variable is the absolute path to the OSD journal, for example /var/lib/ceph/osd/ceph-0/journal.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1Get the object map header:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ get-omaphdr > $OBJECT_MAP_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ get-omaphdr > zone_info.default.omaphdr.txtSet the object map header:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ get-omaphdr < $OBJECT_MAP_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ set-omaphdr < zone_info.default.omaphdr.txt
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3.6. Manipulating the object map key Copy linkLink copied to clipboard!
Use the ceph-objectstore-tool utility to change the object map (OMAP) key. You need to provide the data path, the placement group identifier (PG ID), the object, and the key in the OMAP.
If using FileStore as the OSD backend object store, then add the --journal-path $PATH_TO_JOURNAL argument when getting, setting or removing the object map key. Where the $PATH_TO_JOURNAL variable is the absolute path to the OSD journal, for example /var/lib/ceph/osd/ceph-0/journal.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Get the object map key:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ get-omap $KEY > $OBJECT_MAP_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ get-omap "" > zone_info.default.omap.txtSet the object map key:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ set-omap $KEY < $OBJECT_MAP_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ set-omap "" < zone_info.default.omap.txtRemove the object map key:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ rm-omap $KEYExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ rm-omap ""
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3.7. Listing the object’s attributes Copy linkLink copied to clipboard!
Use the ceph-objectstore-tool utility to list an object’s attributes. The output provides you with the object’s keys and values.
If using FileStore as the OSD backend object store, then add the --journal-path $PATH_TO_JOURNAL argument when listing an object’s attributes. Where the $PATH_TO_JOURNAL variable is the absolute path to the OSD journal, for example /var/lib/ceph/osd/ceph-0/journal.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1List the object’s attributes:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ list-attrsExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ list-attrs
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.3.8. Manipulating the object attribute key Copy linkLink copied to clipboard!
Use the ceph-objectstore-tool utility to change an object’s attributes. To manipulate the object’s attributes you need the data and journal paths, the placement group identifier (PG ID), the object, and the key in the object’s attribute.
If using FileStore as the OSD backend object store, then add the --journal-path $PATH_TO_JOURNAL argument when getting, setting or removing the object’s attributes. Where the $PATH_TO_JOURNAL variable is the absolute path to the OSD journal, for example /var/lib/ceph/osd/ceph-0/journal.
Prerequisites
-
Having
rootaccess to the Ceph OSD node. -
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@$OSD_NUMBERExample
[root@osd ~]# systemctl status ceph-osd@1Get the object’s attributes:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ get-attrs $KEY > $OBJECT_ATTRS_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ get-attrs "oid" > zone_info.default.attr.txtSet an object’s attributes:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ set-attrs $KEY < $OBJECT_ATTRS_FILE_NAMEExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ set-attrs "oid" < zone_info.default.attr.txtRemove an object’s attributes:
Syntax
ceph-objectstore-tool --data-path $PATH_TO_OSD \ --pgid $PG_ID $OBJECT \ rm-attrs $KEYExample
[root@osd ~]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 \ --pgid 0.1c '{"oid":"zone_info.default","key":"","snapid":-2,"hash":235010478,"max":0,"pool":11,"namespace":""}' \ rm-attrs "oid"
Additional Resources
- For more information on stopping an OSD, see the Starting, Stopping, and Restarting a Ceph Daemons by Instance section in the Red Hat Ceph Storage Administration Guide.
8.4. Additional Resources Copy linkLink copied to clipboard!
- For Red Hat Ceph Storage support, see the Red Hat Customer Portal.