Scheduling backups in a remote server

This page describes how to schedule backups for Cassandra without the Cloud Storage.In this method, backups are stored on a remote server specified by you instead of a Cloud Storage bucket. Apigee uses SSH to communicate with the remote server.

You must schedule the backups ascron jobs. Once a backup schedule has been applied to your hybrid cluster, a Kubernetes backup job is periodically executed according to the schedule in the runtime plane. The job interacts with each Cassandra pod in your hybrid cluster to collect all the data, create an archive (compressed) file of the data, and send the archive to the server specified in youroverrides.yaml file.

Note: You must ensure there is enough space on the file system for the backups, and adjust the frequency of the backups to avoid unnecessarily filling the allotted storage space. Apigee does not dictate a retention policy for the backup files. You may want to create a retention policy for files appropriate to your installation.

The following steps include common examples for completing specific tasks, like creating an SSH key pair. Use the methods that are appropriate to your installation.

The procedure has the following parts:

Set up the server and SSH

  1. Designate a Linux or Unix server for your backups. This server must be reachable using SSH from your Apigee hybrid runtime plane. It must have enough storage for your backups.
  2. Set up an SSH server on the server, or ensure that it has a secure SSH server configured.Caution: For security purposes, make sure your SSH server is up to date.
  3. Create an SSH key pair and store the private key file in a path that is accessible from your hybrid runtime plane.You must use a blank password for your key pair or the backup will fail. For example:
    ssh-keygen-trsa-b4096-Cexampleuser@example.comEnterfileinwhichtosavethekey(/Users/exampleuser/.ssh/id_rsa):$APIGEE_HOME/hybrid-files/certs/ssh_keyEnterpassphrase(emptyfornopassphrase):Entersamepassphraseagain:Youridentificationhasbeensavedinssh_keyYourpublickeyhasbeensavedinssh_key.pubThekeyfingerprintis:SHA256:DWKo334XMZcZYLOLrd/8HNpjTERPJJ0mc11UYmrPvSAexampleuser@example.comThekey'srandomartimageis:+---[RSA 4096]----+|+.++X||..o.=.*+||.o..o==o||...=oo+o...||.S+Eoo.||.....o.||....o..||....o++.||....+o+.|+----[SHA256]-----+

    Where:exampleuser@example.com is a string. Any string that follows-C in thessh-keygen command becomes a comment included in the newly createdssh key. The input string can be any string. When you use an account name in the form ofexampleuser@example.com, you can quickly identify which account goes with the key.

  4. Create a user account on the backup server with the nameapigee. Make sure the newapigee user has a home directory under/home.
  5. On the backup server, create an.ssh directory in the new/home/apigee directory.
  6. Copy the public key (ssh_key.pub in the previous example) into a file namedauthorized_keys in the new/home/apigee/.ssh directory. For example:
    cd /home/apigeemkdir .sshcd .sshvi authorized_keys
  7. On your backup server, create a backup directory within the/home/apigee/ directory. The backup directory can be any directory as long as theapigee user has access to it. For example:
    cd /home/apigeemkdir cassandra-backup

Set the schedule and destination for backup

You set the schedule and destination for backups in youroverrides.yaml file.

  1. Add the following parameters to youroverrides.yaml file:

    Parameters

    cassandra:backup:enabled:truekeyFile:"PATH_TO_PRIVATE_KEY_FILE"server:"BACKUP_SERVER_IP"storageDirectory:"/home/apigee/BACKUP_DIRECTORY"cloudProvider:"HYBRID"#requiredverbatim"HYBRID"(allcaps)schedule:"SCHEDULE"

    Example

    cassandra:backup:enabled:truekeyFile:"private.key"#pathrelativetoapigee-datastorepathserver:"34.56.78.90"storageDirectory:"/home/apigee/cassbackup"cloudProvider:"HYBRID"schedule:"0 2 * * *"

    Where:

    PropertyDescription
    backup:enabledBackup is disabled by default. You must set this property totrue.
    backup:keyFile

    PATH_TO_PRIVATE_KEY_FILE

    The path on your local file system to the SSH private key file (namedssh_key inthe step where you created the SSH key pair). This path must be relative to theapigee-datastore chart directory.

    backup:server

    BACKUP_SERVER_IP

    The IP address of your backup server.

    backup:storageDirectory

    BACKUP_DIRECTORY

    The name of the backup directory on your backup server. This must be a directory withinhome/apigee (the backup directory is namedcassandra_backup inthe step where you created the backup directory).

    backup:cloudProvider

    HYBRID

    For a remote server backup, set the property toHYBRID.

    backup:schedule

    SCHEDULE

    The time when the backup starts, specified instandard crontab syntax. Times are in the local time zone of the Kubernetes cluster. Default:0 2 * * *

    Note: Avoid scheduling a backup that starts a short time after you apply the backup configuration to your cluster.
  2. Apply the backup configuration to the storage scope of your cluster:
    helm upgrade datastore apigee-datastore/ \  --install \  --namespaceAPIGEE_NAMESPACE \  --atomic \  -fOVERRIDES_FILE.yaml

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

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

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 2025-12-17 UTC.