Este contenido no está disponible en el idioma seleccionado.
Chapter 8. Troubleshooting Ceph 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.
Prerequisites
- Verify there are no network-related issues.
8.1. Troubleshooting high-level object operations Copiar enlaceEnlace copiado en el portapapeles!
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.
Prerequisites
- Root-level access to the Ceph OSD nodes.
8.1.1. Listing objects Copiar enlaceEnlace copiado en el portapapeles!
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
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-FSID@osd.OSD_ID
systemctl status ceph-FSID@osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Identify all the objects within an OSD, regardless of their placement group:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --op list
ceph-objectstore-tool --data-path PATH_TO_OSD --op listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op list
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Identify all the objects within a placement group:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID --op list
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID --op listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op list
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op listCopy to Clipboard Copied! Toggle word wrap Toggle overflow Identify the PG an object belongs to:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --op list OBJECT_ID
ceph-objectstore-tool --data-path PATH_TO_OSD --op list OBJECT_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op list default.region
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op list default.regionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.1.2. Fixing lost objects Copiar enlaceEnlace copiado en el portapapeles!
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
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-FSID@osd.OSD_ID
systemctl status ceph-FSID@osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow To list all the lost legacy objects:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost --dry-run
ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost --dry-runCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost --dry-run
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost --dry-runCopy to Clipboard Copied! Toggle word wrap Toggle overflow Use 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-lost
ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lostCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lostCopy to Clipboard Copied! Toggle word wrap Toggle overflow To fix all the lost objects within a placement group:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID --op fix-lost
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID --op fix-lostCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op fix-lost
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --pgid 0.1c --op fix-lostCopy to Clipboard Copied! Toggle word wrap Toggle overflow To fix a lost object by its identifier:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost OBJECT_ID
ceph-objectstore-tool --data-path PATH_TO_OSD --op fix-lost OBJECT_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost default.region
[ceph: root@host01 /]# ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-0 --op fix-lost default.regionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2. Troubleshooting low-level object operations Copiar enlaceEnlace copiado en el portapapeles!
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.
Prerequisites
- Root-level access to the Ceph OSD nodes.
8.2.1. Manipulating the object’s content Copiar enlaceEnlace copiado en el portapapeles!
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
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-FSID@osd.OSD_ID
systemctl status ceph-FSID@osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID \ OBJECT \ set-bytes < OBJECT_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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[ceph: root@host01 /]# 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-copyCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.2. Removing an object Copiar enlaceEnlace copiado en el portapapeles!
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
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove an object:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID \ OBJECT \ remove
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID \ OBJECT \ removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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[ceph: root@host01 /]# 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":""}' \ removeCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.3. Listing the object map Copiar enlaceEnlace copiado en el portapapeles!
Use the ceph-objectstore-tool utility to list the contents of the object map (OMAP). The output provides you a list of keys.
Prerequisites
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-osd@OSD_ID
systemctl status ceph-osd@OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the object map:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID \ OBJECT \ list-omap
ceph-objectstore-tool --data-path PATH_TO_OSD --pgid PG_ID \ OBJECT \ list-omapCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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[ceph: root@host01 /]# 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-omapCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.4. Manipulating the object map header Copiar enlaceEnlace copiado en el portapapeles!
The ceph-objectstore-tool utility outputs the object map (OMAP) header with the values associated with the object’s keys.
Prerequisites
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-FSID@osd.OSD_ID
systemctl status ceph-FSID@osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get the object map header:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-omaphdr > OBJECT_MAP_FILE_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-omaphdr > OBJECT_MAP_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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.txt[ceph: root@host01 /]# 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.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the object map header:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-omaphdr < OBJECT_MAP_FILE_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-omaphdr < OBJECT_MAP_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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[ceph: root@host01 /]# 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.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.5. Manipulating the object map key Copiar enlaceEnlace copiado en el portapapeles!
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.
Prerequisites
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get the object map key:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-omap KEY > OBJECT_MAP_FILE_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-omap KEY > OBJECT_MAP_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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.txt[ceph: root@host01 /]# 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.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the object map key:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ set-omap KEY < OBJECT_MAP_FILE_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ set-omap KEY < OBJECT_MAP_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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.txt[ceph: root@host01 /]# 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.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the object map key:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ rm-omap KEY
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ rm-omap KEYCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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 ""[ceph: root@host01 /]# 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 ""Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.6. Listing the object’s attributes Copiar enlaceEnlace copiado en el portapapeles!
Use the ceph-objectstore-tool utility to list an object’s attributes. The output provides you with the object’s keys and values.
Prerequisites
- Root-level access to the Ceph OSD node.
-
Stopping the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-FSID@osd.OSD_ID
systemctl status ceph-FSID@osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the object’s attributes:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ list-attrs
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ list-attrsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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[ceph: root@host01 /]# 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-attrsCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.2.7. Manipulating the object attribute key Copiar enlaceEnlace copiado en el portapapeles!
Use the ceph-objectstore-tool utility to change an object’s attributes. To manipulate the object’s attributes you need the data paths, the placement group identifier (PG ID), the object, and the key in the object’s attribute.
Prerequisites
- Root-level access to the Ceph OSD node.
-
Stop the
ceph-osddaemon.
Procedure
Verify the appropriate OSD is down:
Syntax
systemctl status ceph-FSID@osd.OSD_ID
systemctl status ceph-FSID@osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.service
[root@host01 ~]# systemctl status ceph-b404c440-9e4c-11ec-a28a-001a4a0001df@osd.0.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to the OSD container:
Syntax
cephadm shell --name osd.OSD_ID
cephadm shell --name osd.OSD_IDCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
cephadm shell --name osd.0
[root@host01 ~]# cephadm shell --name osd.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get the object’s attributes:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-attr KEY > OBJECT_ATTRS_FILE_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ get-attr KEY > OBJECT_ATTRS_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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-attr "oid" > zone_info.default.attr.txt[ceph: root@host01 /]# 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-attr "oid" > zone_info.default.attr.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set an object’s attributes:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ set-attr KEY < OBJECT_ATTRS_FILE_NAME
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ set-attr KEY < OBJECT_ATTRS_FILE_NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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-attr "oid" < zone_info.default.attr.txt[ceph: root@host01 /]# 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-attr "oid" < zone_info.default.attr.txtCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove an object’s attributes:
Syntax
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ rm-attr KEY
ceph-objectstore-tool --data-path PATH_TO_OSD \ --pgid PG_ID OBJECT \ rm-attr KEYCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# 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-attr "oid"[ceph: root@host01 /]# 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-attr "oid"Copy to Clipboard Copied! Toggle word wrap Toggle overflow