Halaman ini menjelaskan cara menjadwalkan pencadangan untuk Cassandra di Cloud Storage.
Dalam metode ini, cadangan disimpan di bucket Cloud Storage yang ditentukan.
Untuk menjadwalkan pencadangan Cassandra, lakukan langkah-langkah berikut:
Jalankan perintah create-service-account berikut untuk membuat akun layanan (SA) Google Cloud dengan peran roles/storage.objectAdmin standar.
Peran SA ini memungkinkan Anda menulis data cadangan ke Cloud Storage. E Jalankan perintah berikut di direktori yang sesuai untuk
alat pengelolaan Anda:
Perintah ini membuat satu akun layanan bernama
apigee-non-prod untuk digunakan di lingkungan non-produksi dan
menempatkan file kunci yang didownload di direktori
./service-accounts.
Untuk informasi selengkapnya tentang akun layanan Google Cloud, lihat
Membuat
dan mengelola akun layanan.
Perintah create-service-account menyimpan file JSON yang berisi
kunci pribadi akun layanan. File disimpan di direktori yang sama
tempat perintah dijalankan. Anda akan memerlukan jalur ke file ini
dalam langkah-langkah berikut.
Pencadangan dinonaktifkan secara default. Anda harus menetapkan properti ini ke true.
backup:serviceAccountPath
SA_JSON_FILE_PATH
Jalur di sistem file Anda ke file JSON akun layanan yang didownload saat Anda menjalankan perintah create-service-account.
Untuk penginstalan yang dikelola dengan Helm, jalur harus relatif terhadap direktori diagram apigee-datastore. Misalnya,
serviceAccountPath: myproject-apigee-cassandra.json.
Untuk penginstalan yang dikelola dengan apigeectl, Anda juga dapat memberikan jalur file relatif. Jalur akan bersifat relatif terhadap direktori hybrid-base-directory/hybrid-files.
backup:dbStorageBucket
CLOUD_STORAGE_BUCKET_PATH
Jalur bucket Cloud Storage dalam format ini: gs://BUCKET_NAME.
gs:// wajib diisi.
backup:cloudProvider
GCP
Untuk pencadangan ke Cloud Storage, tetapkan properti ke GCP.
Tugas pencadangan dipicu secara otomatis sesuai dengan jadwal cron yang ditetapkan di
cassandra.backup.schedule dalam file
overrides.yaml Anda. Namun, Anda juga dapat memulai tugas pencadangan secara manual jika diperlukan
menggunakan perintah berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 UTC."],[[["\u003cp\u003eThis document guides users on scheduling Cassandra backups to Cloud Storage within Apigee hybrid version 1.11, noting a known issue with backups using \u003ccode\u003eHYBRID\u003c/code\u003e or \u003ccode\u003eGCP\u003c/code\u003e Cloud Providers.\u003c/p\u003e\n"],["\u003cp\u003eA Google Cloud service account with the \u003ccode\u003eroles/storage.objectAdmin\u003c/code\u003e role must be created to enable writing backup data to Cloud Storage, using the \u003ccode\u003ecreate-service-account\u003c/code\u003e command with specific environment flags.\u003c/p\u003e\n"],["\u003cp\u003eUsers must create a Cloud Storage bucket with a specified retention policy, recommended to be 15 days, to store backups, and provide its path in the \u003ccode\u003eoverrides.yaml\u003c/code\u003e configuration file.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eoverrides.yaml\u003c/code\u003e file requires specific \u003ccode\u003ecassandra.backup\u003c/code\u003e properties, including enabling backups, the service account JSON file path, the Cloud Storage bucket path, the desired backup schedule, and setting the cloud provider to \u003ccode\u003eGCP\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eBackups can be triggered automatically via a cron schedule defined in the \u003ccode\u003eoverrides.yaml\u003c/code\u003e file or manually using a \u003ccode\u003ekubectl\u003c/code\u003e command, but scheduling a backup shortly after applying changes might cause it to fail.\u003c/p\u003e\n"]]],[],null,["# Scheduling backups in Cloud Storage\n\n| 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, see [Supported versions](/apigee/docs/hybrid/supported-platforms#supported-versions).\n| **Warning:** This Apigee Hybrid version has a known issue [388608440](/apigee/docs/release/known-issues#388608440) affecting backups that use `HYBRID` or `GCP` Cloud Providers. Please see the [Cassandra troubleshooting guide](/apigee/docs/api-platform/troubleshoot/playbooks/cassandra/ts-cassandra#ki-388608440-hybrid-gcs-backup-111) to check whether your setup is affected and for steps needed for resolution.\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`](/storage/docs/access-control/iam-roles) 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:\n - **Helm charts:** \u003cvar translate=\"no\"\u003e$APIGEE_HELM_CHARTS_HOME\u003c/var\u003e`/apigee-operator/etc/`\n - **`apigeectl`:** \u003cvar translate=\"no\"\u003eHYBRID_BASE_DIRECTORY\u003c/var\u003e`/hybrid-files/`\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](/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](/storage/docs/creating-buckets). Specify a reasonable data [retention policy](/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\" # required verbatim \"GCP\" (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: \"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 ### Helm\n\n ```\n helm upgrade datastore apigee-datastore/ \\\n --namespace APIGEE_NAMESPACE \\\n --atomic \\\n -f OVERRIDES_FILE.yaml\n ```\n | **Note:** If you see an error saying `Error: UPGRADE FAILED: \"datastore\" has no deployed releases`, replace `upgrade` with `install` and try the command again.\n\n ### `apigeectl`\n\n ```\n $APIGEECTL_HOME/apigeectl apply -f OVERRIDES_FILE.yaml --datastore\n ```\n\n\n Where \u003cvar translate=\"no\"\u003eOVERRIDES_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_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 ```\n\nLaunch a manual backup\n----------------------\n\n\nBackup jobs are triggered automatically according to the cron schedule set in\n[cassandra.backup.schedule](/apigee/docs/hybrid/v1.11/config-prop-ref#cassandra-backup-schedule) in your\n`overrides.yaml` file. However, you can also initiate a backup job manually if needed\nusing the following command: \n\n```\nkubectl create job -n APIGEE_NAMESPACE --from=cronjob/apigee-cassandra-backup MANUAL_BACKUP_JOB_NAME\n```\n\nWhere \u003cvar translate=\"no\"\u003eMANUAL_BACKUP_JOB_NAME\u003c/var\u003e is the name of a manual backup job to be be created."]]