Scheduling backups in Cloud Storage

You are currently viewing version 1.11 of the Apigee hybrid documentation.This version is end of life. You should upgrade to a newer version. For more information, seeSupported versions.
Warning: This Apigee Hybrid version has a known issue388608440 affecting backups that useHYBRID orGCP Cloud Providers. Please see theCassandra troubleshooting guide to check whether your setup is affected and for steps needed for resolution.

This page describes how to schedule backups for Cassandra in Cloud Storage. In this method, backups are stored in the specified Cloud Storage bucket.

Note: After applying the backup configuration on the existing cluster, the Cassandra pods will restart one after another (rolling restart) from last to first.

To schedule Cassandra backups, perform the following steps:

  1. Run the followingcreate-service-account command to create a Google Cloud service account (SA) with the standardroles/storage.objectAdmin role. This SA role allows you to write backup data to Cloud Storage. E Execute the following command in the directory appropriate for your management tool:
    • Helm charts:$APIGEE_HELM_CHARTS_HOME/apigee-operator/etc/
    • apigeectl:HYBRID_BASE_DIRECTORY/hybrid-files/
    ./tools/create-service-account --env non-prod --dir ./service-accounts
    This command creates a single service account namedapigee-non-prod for use in non-production environments and places the downloaded key file in the./service-accounts directory.Note: If you prefer to create all the individual service accounts for a production environment, use the following command:
    ./tools/create-service-account--env prod --dir ./service-accounts
    For more information about Google Cloud service accounts, see
    Creating and managing service accounts.
  2. Thecreate-service-account command saves a JSON file containing the service account private key. The file is saved in the same directory where the command executes. You will need the path to this file in the following steps.
  3. Create a Cloud Storage bucket. Specify a reasonable data retention policy for the bucket. Apigee recommends a data retention policy of 15 days.
  4. Open youroverrides.yaml file.
  5. Add the followingcassandra.backup properties to enable backup. Do not remove any of the properties that are already configured.

    Parameters

    cassandra:    ...    backup:      enabled: true      serviceAccountPath:SA_JSON_FILE_PATH      dbStorageBucket:CLOUD_STORAGE_BUCKET_PATH      schedule:BACKUP_SCHEDULE_CODE      cloudProvider: "GCP" # required verbatim "GCP" (all caps)    ...

    Example

    ...cassandra:storage:type:gcepdcapacity:50Gigcepd:replicationType:regional-pdauth:default:password:"abc123"admin:password:"abc234"ddl:password:"abc345"dml:password:"abc456"nodeSelector:key:cloud.google.com/gke-nodepoolvalue:apigee-databackup:enabled:trueserviceAccountPath:"my-cassandra-backup-sa.json"dbStorageBucket:"gs://myname-cassandra-backup"schedule:"45 23 * * 6"cloudProvider:"GCP"...
  6. Where:
    PropertyDescription
    backup:enabledBackup is disabled by default. You must set this property totrue.
    backup:serviceAccountPath

    SA_JSON_FILE_PATH

    The path on your filesystem to the service account JSON file that was downloaded when you ran thecreate-service-account command.

    For installations managed with Helm, the path must be relative to the apigee-datastore chart directory. For example,
    serviceAccountPath: myproject-apigee-cassandra.json.

    For installations managed withapigeectl, you can also provide a relative file path. The path will be relative to thehybrid-base-directory/hybrid-files directory.

    backup:dbStorageBucket

    CLOUD_STORAGE_BUCKET_PATH

    The Cloud Storage bucket path in this format:gs://BUCKET_NAME. Thegs:// is required.

    backup:cloudProvider

    GCP

    For a backup to Cloud Storage, set the property toGCP.

    backup:schedule

    BACKUP_SCHEDULE_CODE

    The time when the backup starts, specified instandard crontab syntax. Default:0 2 * * *

    Note: Avoid scheduling a backup that starts a short time after you apply the backup configuration to your cluster. When you apply the backup configuration, Kubernetes recreates the Cassandra nodes. If the backup starts before the nodes restart, the first backup will fail and the subsequent backups will pass.
  7. Apply the configuration changes to the new cluster. For example:

    Helm

    helm upgrade datastore apigee-datastore/ \  --namespaceAPIGEE_NAMESPACE \  --atomic \  -fOVERRIDES_FILE.yaml
    Note: If you see an error sayingError: UPGRADE FAILED: "datastore" has no deployed releases, replaceupgrade withinstall and try the command again.

    apigeectl

    $APIGEECTL_HOME/apigeectl apply -fOVERRIDES_FILE.yaml --datastore

    WhereOVERRIDES_FILE is the path to the overrides file you just edited.

  8. Verify the backup job. For example:
    kubectl get cronjob -nAPIGEE_NAMESPACE
    NAMESCHEDULESUSPENDACTIVELASTSCHEDULEAGEapigee-cassandra-backup33****False0        <none>94s

Launch a manual backup

Backup jobs are triggered automatically according to the cron schedule set incassandra.backup.schedule in youroverrides.yaml file. However, you can also initiate a backup job manually if needed using the following command:

kubectl create job -nAPIGEE_NAMESPACE --from=cronjob/apigee-cassandra-backupMANUAL_BACKUP_JOB_NAME

WhereMANUAL_BACKUP_JOB_NAME is the name of a manual backup job to be be created.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.