En esta página, se describe cómo programar copias de seguridad para Cassandra sin Cloud Storage.
En este método, las copias de seguridad se almacenan en un servidor remoto que tú especificas en lugar de un bucket de Cloud Storage. Apigee usa SSH para comunicarse con el servidor remoto.
Debes programar las copias de seguridad como trabajos cron. Una vez que se aplica una programación de copia de seguridad a tu clúster híbrido, se ejecuta un trabajo de copia de seguridad de Kubernetes de forma periódica según la programación en el plano de entorno de ejecución. El trabajo activa una secuencia de comandos de copia de seguridad en cada nodo de Cassandra en tu clúster híbrido que recopila todos los datos en el nodo, crea un archivo (comprimido) de los datos y envía el archivo al servidor especificado en tu archivo overrides.yaml.
En los siguientes pasos, se incluyen ejemplos comunes para completar tareas específicas, como crear un par de claves SSH. Usa los métodos adecuados para tu instalación.
Designa un servidor Linux o Unix para tus copias de seguridad. Se debe poder acceder a este servidor mediante SSH con el plano de entorno de ejecución de Apigee Hybrid. Debe tener suficiente almacenamiento para tus copias de seguridad.
Configura un servidor SSH o asegúrate de que tenga configurado un servidor SSH seguro.
Crea un par de claves SSH y almacena el archivo de claves privadas en una ruta a la que se pueda acceder desde tu plano de entorno de ejecución híbrido. Debes usar una contraseña en blanco para tu par de claves o la copia de seguridad no funcionará. Por ejemplo:
En el ejemplo anterior, exampleuser@example.com es una cadena.
Cualquier cadena que siga a -C en el comando ssh-keygen se convierte en un comentario incluido en la clave ssh recién creada. La cadena de entrada puede ser cualquier cadena. Cuando usas un nombre de cuenta con el formato exampleuser@example.com, puedes identificar rápidamente qué cuenta coincide con la clave
Crea una cuenta de usuario en el servidor de copia de seguridad con el nombre apigee. Asegúrate de que el usuario apigee nuevo tenga un directorio principal en /home.
En el servidor de copia de seguridad, crea un directorio .ssh en el directorio /home/apigee nuevo.
Copia la clave pública (ssh_key.pub en el ejemplo anterior) en un archivo llamado authorized_keys en el directorio /home/apigee/.ssh nuevo. Por ejemplo:
cd /home/apigee
mkdir .sshcd .sshvi authorized_keys
En tu servidor de copia de seguridad, crea un directorio de copia de seguridad dentro del directorio /home/apigee/. El directorio de copia de seguridad puede ser cualquier directorio, siempre y cuando el usuario apigee tenga acceso a él. Por ejemplo:
cd /home/apigee
mkdir cassandra-backup
Prueba la conexión. Debes asegurarte de que los pods de Cassandra se puedan conectar al servidor de copia de seguridad mediante SSH:
Accede a la shell de tu Pod de Cassandra. Por ejemplo:
La copia de seguridad está inhabilitada de forma predeterminada. Debes establecer esta propiedad en true.
backup:keyFile
PATH_TO_PRIVATE_KEY_FILE
La ruta de tu sistema de archivos local al archivo de claves privadas SSH (llamado ssh_key en el paso en el que creaste el par de claves SSH). Esta ruta de acceso debe ser relativa al directorio del gráfico apigee-datastore.
backup:server
BACKUP_SERVER_IP
La dirección IP de tu servidor de copia de seguridad.
backup:storageDirectory
BACKUP_DIRECTORY
El nombre del directorio de copia de seguridad de tu servidor de copia de seguridad. Debe ser un directorio dentro de home/apigee (el directorio de copia de seguridad se llama cassandra_backup en el paso en el que creaste el directorio de copia de seguridad).
backup:cloudProvider
GCP/HYBRID
Para una copia de seguridad de Cloud Storage, establece la propiedad en GCP. Por ejemplo, cloudProvider: "GCP".
Para una copia de seguridad del servidor remoto, configura la propiedad como HYBRID. Por ejemplo, cloudProvider: "HYBRID".
backup:schedule
SCHEDULE
El momento en el que se inicia la copia de seguridad, especificado en sintaxis de crontab estándar. Los horarios se encuentran en la zona horaria local del clúster de Kubernetes. Predeterminada: 0 2 * * *
Aplica la configuración de copia de seguridad al permiso de almacenamiento de tu
clúster:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-28 (UTC)"],[[["\u003cp\u003eThis document outlines the process for scheduling Cassandra backups to a remote server via SSH, rather than using Cloud Storage, within an Apigee hybrid environment.\u003c/p\u003e\n"],["\u003cp\u003eBackups are scheduled using \u003ccode\u003ecron\u003c/code\u003e jobs, and each scheduled job triggers a Kubernetes process that collects data from Cassandra pods, compresses it, and sends it to the remote server specified in the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eSetting up the backup server involves designating a Linux/Unix server reachable by SSH, creating an SSH key pair with a blank password, and establishing an \u003ccode\u003eapigee\u003c/code\u003e user with appropriate directory permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe backup schedule and destination details, including the server IP, private key path, and storage directory, must be defined within the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file under the \u003ccode\u003ecassandra:backup:\u003c/code\u003e section, and the \u003ccode\u003ecloudProvider\u003c/code\u003e must be set to "HYBRID".\u003c/p\u003e\n"],["\u003cp\u003eAfter editing the \u003ccode\u003eoverrides.yaml\u003c/code\u003e, you should apply the configurations to the storage scope of the cluster and verify the \u003ccode\u003ecronjob\u003c/code\u003e has been created.\u003c/p\u003e\n"]]],[],null,["# Scheduling backups in a remote server\n\n| You are currently viewing version 1.13 of the Apigee hybrid documentation. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\nThis page describes how to schedule backups for Cassandra without the Cloud Storage.\nIn this method, backups are stored on a remote server specified by you instead of a Cloud Storage bucket. Apigee uses\nSSH to communicate with the remote server.\n\nYou must schedule the backups as `cron` jobs. Once a backup schedule has been applied\nto your hybrid cluster, a Kubernetes backup job is periodically executed according to the schedule\nin the runtime plane. The job interacts with each Cassandra pod in your hybrid cluster to collect\nall the data, create an archive (compressed) file of the data, and send the archive to the server\nspecified in your `overrides.yaml` file.\n| **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.\n\n\nThe following steps include common examples for completing specific tasks, like creating an SSH\nkey pair. Use the methods that are appropriate to your installation.\n\n\nThe procedure has the following parts:\n\n- [Set up the server and SSH](#server-ssh)\n- [Set the schedule and destination for backup](#overrides-backup)\n\n### Set up the server and SSH\n\n1. 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.\n2. 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.\n3. 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: \n\n ssh-keygen -t rsa -b 4096 -C \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eexampleuser\u003c/span\u003e\u003cspan class=\"devsite-syntax-nv\"\u003e@example\u003c/span\u003e\u003cspan class=\"devsite-syntax-p\"\u003e.\u003c/span\u003e\u003cspan class=\"devsite-syntax-n\"\u003ecom\u003c/span\u003e\u003c/var\u003e\n Enter file in which to save the key (/Users/exampleuser/.ssh/id_rsa): $APIGEE_HOME/hybrid-files/certs/ssh_key\n Enter passphrase (empty for no passphrase):\n Enter same passphrase again:\n Your identification has been saved in ssh_key\n Your public key has been saved in ssh_key.pub\n The key fingerprint is:\n SHA256:DWKo334XMZcZYLOLrd/8HNpjTERPJJ0mc11UYmrPvSA exampleuser@example.com\n The key's randomart image is:\n +---[RSA 4096]----+\n | +. ++X|\n | . . o.=.*+|\n | . o . . o==o |\n | . . . =oo+o...|\n | . S +E oo .|\n | . . .. . o .|\n | . . . . o.. |\n | . ...o ++. |\n | .. .. +o+. |\n +----[SHA256]-----+\n\n\n Where: \u003cvar translate=\"no\"\u003eexampleuser@example.com\u003c/var\u003e is a string.\n Any string that follows `-C` in the `ssh-keygen`\n command becomes a comment included in the newly created `ssh`\n key. The input string can be any string. When you use an account name\n in the form of \u003cvar translate=\"no\"\u003eexampleuser@example.com\u003c/var\u003e, you can quickly\n identify which account goes with the key.\n4. Create a user account on the backup server with the name `apigee`. Make sure the new `apigee` user has a home directory under `/home`.\n5. On the backup server, create an `.ssh` directory in the new `/home/apigee` directory.\n6. Copy the public key (`ssh_key.pub` in the previous example) into a file named `authorized_keys` in the new `/home/apigee/.ssh` directory. For example: \n\n cd /home/apigee\n mkdir .ssh\n cd .ssh\n vi authorized_keys\n\n7. On your backup server, create a backup directory within the `/home/apigee/` directory. The backup directory can be any directory as long as the `apigee` user has access to it. For example: \n\n cd /home/apigee\n mkdir cassandra-backup\n\n### Set the schedule and destination for backup\n\n\nYou set the schedule and destination for backups in your `overrides.yaml` file.\n\n1. Add the following parameters to your `overrides.yaml` file:\n\n ### Parameters\n\n ```actionscript-3\n cassandra:\n backup:\n enabled: true\n keyFile: \"\u003cvar translate=\"no\"\u003ePATH_TO_PRIVATE_KEY_FILE\u003c/var\u003e\"\n server: \"\u003cvar translate=\"no\"\u003eBACKUP_SERVER_IP\u003c/var\u003e\"\n storageDirectory: \"/home/apigee/\u003cvar translate=\"no\"\u003eBACKUP_DIRECTORY\u003c/var\u003e\"\n cloudProvider: \"HYBRID\" # required verbatim \"HYBRID\" (all caps)\n schedule: \"\u003cvar translate=\"no\"\u003eSCHEDULE\u003c/var\u003e\"\n ```\n\n ### Example\n\n ```actionscript-3\n cassandra:\n backup:\n enabled: true\n keyFile: \"private.key\"# path relative to apigee-datastore path\n server: \"34.56.78.90\"\n storageDirectory: \"/home/apigee/cassbackup\"\n cloudProvider: \"HYBRID\"\n schedule: \"0 2 * * *\"\n ```\n\n\n Where:\n\n2. Apply the backup configuration to the storage scope of your cluster: \n\n ```\n helm upgrade datastore apigee-datastore/ \\\n --install \\\n --namespace APIGEE_NAMESPACE \\\n --atomic \\\n -f OVERRIDES_FILE.yaml\n ```\n\n Where \u003cvar translate=\"no\"\u003eOVERRIDES_FILE\u003c/var\u003e is the path to the overrides file you just edited.\n3. Verify the backup job. For example: \n\n ```\n kubectl get cronjob -n APIGEE_NAMESPACE\n ``` \n\n ```component-pascal\n NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE\n apigee-cassandra-backup 33 * * * * False 0 \u003cnone\u003e 94s\n ```"]]