Chapter 9. Customizing the Object Storage service (swift)
You can customize some of the default settings of the Object Storage service (swift) to optimize deployment performance.
9.1. Prerequisites Copy linkLink copied to clipboard!
-
You have the
occommand line tool installed on your workstation. -
You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges.
9.2. Changing default parameters for object storage Copy linkLink copied to clipboard!
You can customize the following options for your Object Storage service (swift) deployment in the OpenStackControlPlane CR:
| Option | Description |
|---|---|
|
| Enables the Ceilometer middleware in the proxy server. |
|
| Enables object encryption by using the Key Manager service (barbican). |
|
| Sets the minimum time in hours before a partition in a ring can be moved following a rebalance. |
|
| Sets the partition power to use when building Object Storage rings. |
|
| Sets the number of object replicas to use in the Object Storage rings. |
You can customize the following configuration files for Object Storage services by using the defaultConfigOverwrite parameter and keys in the OpenStackControlPlane CR:
| Service | Key |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Procedure
Open your
OpenStackControlPlaneCR file,openstack_control_plane.yaml, and enable Ceilometer middleware and object encryption under theswiftProxyparameter in theswifttemplate:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add values for
minPartHours,partPower, andringReplicasunder theswiftRingparameter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<number_of_hours>with the minimum time in hours before you want a partition in a ring to be moved following a rebalance. -
Replace
<partition_power>with the partition power you want to use when building Object Storage rings, for example,12. -
Replace
<number_of_copies>with the number of object copies you want in your cluster.
-
Replace
Change the number of workers in the
object-serverservice by adding thedefaultConfigOverwriteparameter under theswiftStorageparameter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<number_of_workers>with the number of workers you want in theobject-serverservice.
-
Replace
Update the control plane:
oc apply -f openstack_control_plane.yaml -n openstack
$ oc apply -f openstack_control_plane.yaml -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow Wait until RHOCP creates the resources related to the
OpenStackControlPlaneCR. Run the following command to check the status:oc get openstackcontrolplane -n openstack
$ oc get openstackcontrolplane -n openstackCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
OpenStackControlPlaneresources are created when the status is "Setup complete".TipAppend the
-woption to the end of thegetcommand to track deployment progress.
9.3. Customizing the Object Storage service on external data plane nodes Copy linkLink copied to clipboard!
When you have deployed the Object Storage service (swift) on external data plane nodes, you can customize the default service configuration by including additional ConfigMap or Secret CRs in your OpenStackDataPlaneService CR. You then add the custom service name to your OpenStackDataPlaneNodeSet CR.
The default service configuration is as follows:
When you create a custom service, use a custom service name, for example, swift-customized, and add the custom service name to the list of services in your OpenStackDataPlaneNodeSet CR. For more information about creating a custom service, see Creating and enabling a custom service in Customizing the Red Hat OpenStack Services on OpenShift deployment.
You can also customize the Object Storage service by applying different configurations to different node sets. For example, if you have two different types of nodes with different performance characteristics, you can use different configuration files with specific settings for each node set. For more information about customizing node sets, see Configuring a node set for a feature or workload in Customizing the Red Hat OpenStack Services on OpenShift deployment.
9.4. Custom rings Copy linkLink copied to clipboard!
You can create custom rings to update existing Object Storage service (swift) clusters.
When you add new nodes to a cluster, their characteristics might differ from those of the original nodes. Without custom adjustments, the larger capacity of the new nodes may be underused, or if weights change in the rings, data dispersion can become uneven, which reduces safety.
The ring builder helps manage Object Storage as clusters grow and technologies evolve. For assistance with creating custom rings, contact Red Hat Support.
9.5. Checking Object Storage service cluster health Copy linkLink copied to clipboard!
The Object Storage service (swift) runs many processes in the background to ensure long-term data availability, durability, and persistence. For example:
- Auditors constantly re-read database and object files and compare them by using checksums to make sure there is no silent bit-rot. Any database or object file that no longer matches its checksum is quarantined and becomes unreadable on that node. The replicators then copy one of the other replicas to make the local copy available again.
- Objects and files can disappear when you replace disks or nodes or when objects are quarantined. When this happens, replicators copy missing objects or database files to one of the other nodes.
The Object Storage service includes a tool called swift-recon that collects data from all nodes and checks the overall cluster health. You can use the swift-recon command line utility to obtain metrics from the account, container, and object servers.
Procedure
- Log in to one of the Controller nodes.
Run the following command:
oc debug --keep-labels=true job/swift-ring-rebalance -- /bin/sh -c 'swift-ring-tool get && swift-recon -arqlT --md5'
$ oc debug --keep-labels=true job/swift-ring-rebalance -- /bin/sh -c 'swift-ring-tool get && swift-recon -arqlT --md5'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Use the
--alloption to return additional output.This command queries all servers on the ring for the following data:
- Async pendings: If the cluster load is too high and processes cannot update database files fast enough, some updates occur asynchronously. These numbers decrease over time.
- Replication metrics: Review the replication timestamps; full replication passes happen frequently with few errors. An old entry, for example, an entry with a timestamp from six months ago, indicates that replication on the node has not completed in the last six months.
- Ring md5sums: This ensures that all ring files are consistent on all nodes.
-
swift.confmd5sums: This ensures that all configuration files are consistent on all nodes. - Quarantined files: There must be no, or very few, quarantined files for all nodes.
- Time-sync: All nodes must be synchronized.