Configuring backup and restore for OpenSearch
Configure IBM Cloud Object Storage (COS) as an OpenSearch snapshot repository and use it to back up and restore indices.
Before you begin
- Provision an OpenSearch service instance.
- Ensure you have cluster permissions to create Kubernetes secrets and edit OpenSearch custom resources.
- Install and configure the OpenShift CLI (
oc) and Kubernetes CLI (kubectl). - Ensure you have the COS bucket name, access key, and secret key.
- Ensure you know the OpenSearch admin credentials, the operator namespace
(
<os-operator-ns>), and the OpenSearch cluster name (<os-test-cluster>).
About this task
OpenSearch supports the S3 repository type for snapshots. IBM Cloud Object Storage provides an S3-compatible API that you can use as a snapshot repository. This task walks you through creating a secret for COS credentials, adding that secret to the OpenSearch keystore, registering a snapshot repository, and taking and restoring snapshots.
Procedure
Results
IBM Cloud Object Storage is configured as the OpenSearch snapshot repository. You can create and manage snapshots and restore data as required.
What to do next
- Set up a scheduled snapshot process using your preferred automation (for example, a CronJob or external scheduler).
- Monitor snapshot health and repository size usage regularly.
- Rotate credentials and update the keystore secret when keys change.
Troubleshooting:
- If repository registration fails, verify that the COS endpoint, bucket name, and keystore credentials are correct, and ensure the OpenSearch nodes have network egress to the COS endpoint.
- If snapshots fail to complete, check the OpenSearch logs for S3 client errors and confirm that
the bucket IAM policy allows
PutObject,GetObject,ListBucket, andDeleteObjectoperations.
Security considerations:
- Limit access to the credentials secret via namespace RBAC.
- Use TLS for all connections to the COS endpoint and validate certificates.
- Apply lifecycle policies to the bucket to control retention and costs.