Auf dieser Seite wird beschrieben, wie Sie Sicherungen für Cassandra in Cloud Storage planen können.
Bei dieser Methode werden Sicherungen im angegebenen Cloud Storage-Bucket gespeichert.
Führen Sie die folgenden Schritte aus, um Cassandra-Backups zu planen:
Führen Sie den folgenden Befehl create-service-account aus, um ein Google Cloud-Dienstkonto (Service Account, SA) mit der Standardrolle roles/storage.objectAdmin zu erstellen.
Mit dieser SA-Rolle können Sie Sicherungsdaten in Cloud Storage schreiben. Führen Sie den folgenden Befehl im Verzeichnis hybrid-base-directory/hybrid-files aus:
Mit diesem Befehl wird ein einzelnes Dienstkonto mit dem Namen apigee-non-prod für die Verwendung in einer Nicht-Produktionsumgebung erstellt und die heruntergeladene Schlüsseldatei im Verzeichnis ./service-accounts abgelegt.
Weitere Informationen zu Google Cloud-Dienstkonten finden Sie unter Dienstkonten erstellen und verwalten.
Mit dem Befehl create-service-account wird eine JSON-Datei mit dem privaten Schlüssel des Dienstkontos gespeichert. Die Datei wird im selben Verzeichnis gespeichert, in dem der Befehl ausgeführt wird. Sie benötigen den Pfad zu dieser Datei in den folgenden Schritten.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-28 (UTC)."],[[["\u003cp\u003eThis documentation outlines the process for scheduling Cassandra backups to a Cloud Storage bucket within the Apigee hybrid environment, using version 1.9 of the documentation.\u003c/p\u003e\n"],["\u003cp\u003eTo enable backups, you must first create a Google Cloud service account with the \u003ccode\u003eroles/storage.objectAdmin\u003c/code\u003e role using the \u003ccode\u003ecreate-service-account\u003c/code\u003e tool, which generates a JSON key file needed for authentication.\u003c/p\u003e\n"],["\u003cp\u003eA Cloud Storage bucket must be created, for which the location and a data retention policy (15 days recommended) need to be defined, for the system to push the backup files to.\u003c/p\u003e\n"],["\u003cp\u003eYou must modify the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file to enable the backup functionality, specifying the service account JSON file path, the Cloud Storage bucket path, the backup schedule in crontab syntax, and setting \u003ccode\u003ecloudProvider\u003c/code\u003e to "GCP".\u003c/p\u003e\n"],["\u003cp\u003eOnce the edits have been applied to the \u003ccode\u003eoverrides.yaml\u003c/code\u003e, you can apply these changes to the cluster using the \u003ccode\u003e$APIGEECTL_HOME/apigeectl apply --datastore\u003c/code\u003e command and then verify the successful creation of the backup cron job.\u003c/p\u003e\n"]]],[],null,["# Scheduling backups in Cloud Storage\n\n| You are currently viewing version 1.9 of the Apigee hybrid documentation. **This version is end of life.** You should upgrade to a newer version. For more information, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n\nThis page describes how to schedule backups for Cassandra in Cloud Storage.\nIn this method, backups are stored in the specified Cloud Storage bucket.\n| **Note:** After applying the backup configuration on the existing cluster, the Cassandra pods will restart one after another (rolling restart) from last to first.\n\nTo schedule Cassandra backups, perform the following steps:\n\n1. Run the following `create-service-account` command to create a Google Cloud service account (SA) with the standard [`roles/storage.objectAdmin`](https://cloud.google.com/storage/docs/access-control/iam-roles) role. This SA role allows you to write backup data to Cloud Storage. Execute the following command in the \u003cvar translate=\"no\"\u003ehybrid-base-directory\u003c/var\u003e`/hybrid-files` directory: \n\n ```\n ./tools/create-service-account --env non-prod --dir ./service-accounts\n ```\n This command creates a single service account named `apigee-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: \n |\n | ```\n | ./tools/create-service-account --env prod --dir ./service-accounts\n | ```\n For more information about Google Cloud service accounts, see [Creating\n and managing service accounts](https://cloud.google.com/iam/docs/creating-managing-service-accounts).\n2. The `create-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.\n3. [Create a Cloud Storage bucket](https://cloud.google.com/storage/docs/creating-buckets). Specify a reasonable data [retention policy](https://cloud.google.com/storage/docs/bucket-lock#retention-policy) for the bucket. Apigee recommends a data retention policy of 15 days.\n4. Open your `overrides.yaml` file.\n5. Add the following `cassandra.backup` properties to enable backup. Do not remove any of the properties that are already configured.\n\n ### Parameters\n\n ```scdoc\n cassandra:\n ...\n\n backup:\n enabled: true\n serviceAccountPath: SA_JSON_FILE_PATH\n dbStorageBucket: CLOUD_STORAGE_BUCKET_PATH\n schedule: BACKUP_SCHEDULE_CODE\n cloudProvider: \"GCP\" # For remote server backup set this to HYBRID (all caps)\n\n ...\n \n ```\n\n ### Example\n\n ```carbon\n ...\n\n cassandra:\n storage:\n type: gcepd\n capacity: 50Gi\n gcepd:\n replicationType: regional-pd\n auth:\n default:\n password: \"abc123\"\n admin:\n password: \"abc234\"\n ddl:\n password: \"abc345\"\n dml:\n password: \"abc456\"\n nodeSelector:\n key: cloud.google.com/gke-nodepool\n value: apigee-data\n backup:\n enabled: true\n serviceAccountPath: \"/Users/myhome/.ssh/my-cassandra-backup-sa.json\"\n dbStorageBucket: \"gs://myname-cassandra-backup\"\n schedule: \"45 23 * * 6\"\n cloudProvider: \"GCP\"\n \n\n\n ... \n ```\nWhere:\n\n6. Apply the configuration changes to the new cluster. For example: \n\n ```\n $APIGEECTL_HOME/apigeectl apply --datastore -f YOUR_OVERRIDES_FILE\n ```\n\n\n Where \u003cvar translate=\"no\"\u003eYOUR_OVERRIDES_FILE\u003c/var\u003e is the path to the overrides file you just edited.\n7. Verify the backup job. For example: \n\n ```\n kubectl get cronjob -n apigee\n ``` \n\n ```component-pascal\n NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE\n apigee-cassandra-backup 33 * * * * False 0 \u003cnone\u003e 94s\n ```"]]