[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-25。"],[[["\u003cp\u003eThis guide outlines the process for creating on-demand backups of AlloyDB cluster data, ensuring the cluster and its primary instance are in the "Ready" state before initiating the backup.\u003c/p\u003e\n"],["\u003cp\u003eBackups can be initiated through the Google Cloud console or using the \u003ccode\u003egcloud\u003c/code\u003e CLI, providing flexibility in managing your AlloyDB data.\u003c/p\u003e\n"],["\u003cp\u003eCreating an on-demand backup via the Google Cloud Console involves navigating to the Backups page, selecting the source cluster, specifying backup details, and the option to use Customer-Managed Encryption Keys (CMEK).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud\u003c/code\u003e CLI method utilizes the \u003ccode\u003egcloud alloydb backups create\u003c/code\u003e command, with options for specifying cluster, region, project IDs, and the option to encrypt backups with CMEK, and returns an operation ID that can be used to check its status.\u003c/p\u003e\n"],["\u003cp\u003eBefore creating a backup, users must have appropriate IAM roles, such as \u003ccode\u003eroles/alloydb.admin\u003c/code\u003e, \u003ccode\u003eroles/owner\u003c/code\u003e, or \u003ccode\u003eroles/editor\u003c/code\u003e, in their Google Cloud project to gain access.\u003c/p\u003e\n"]]],[],null,["# Create an on-demand backup\n\nThis page describes how to create an on-demand backup of\nan AlloyDB cluster's data.\n\nWhen you create an on-demand backup, AlloyDB checks that the\ncluster you're backing up and its primary instance are in the \"Ready\" state, and\nthen it starts a long-running operation to perform the backup of the cluster\ndata.\n\n\nBefore you begin\n----------------\n\n- The Google Cloud project you are using must have been [enabled to access AlloyDB](/alloydb/docs/project-enable-access).\n- You must have one of these IAM roles in the Google Cloud project you are using:\n - `roles/alloydb.admin` (the AlloyDB Admin predefined IAM role)\n - `roles/owner` (the Owner basic IAM role)\n - `roles/editor` (the Editor basic IAM role)\n\n If you don't have any of these roles, contact your Organization Administrator to request\n access.\n\n\u003cbr /\u003e\n\nProcedure\n---------\n\n### Console\n\n1. In the Google Cloud console, go to the **Backups** page.\n\n [Go to Backups](https://console.cloud.google.com/alloydb/backups)\n2. Click **Create backup**.\n3. Select the source cluster you want to back up.\n4. Enter an ID for the backup.\n5. If desired, enter a description to help you identify this backup.\n6. If you want to encrypt this backup using [Customer-managed encryption key (CMEK)](/alloydb/docs/cmek)\n instead of Google-managed encryption, follow these\n additional steps:\n\n 1. Click **Advanced encryption options**.\n 2. Select **Customer-managed encryption key (CMEK)**.\n 3. Select a\n customer-managed key from the menu that appears.\n\n The Google Cloud console limits this list to keys within\n the same Google Cloud project and region as the new\n cluster. To use a key that is not on this list, click\n **Don't see your key? Enter key resource name**,\n and then type the key's resource name into the resulting\n dialog.\n\n Note that using CMEK with AlloyDB requires\n some additional setup. For more information, see [Using CMEK with\n AlloyDB](/alloydb/docs/use-cmek).\n7. Click **Create**.\n\nAlloyDB checks that the source cluster is in the \"Ready\"\nstate and then starts a long-running operation to perform the backup. The\n**Backups** page shows the backup with a status of \"In progress\" until\nthe operation completes.\n\n### gcloud\n\nTo use the gcloud CLI, you can\n[install and initialize](/sdk/docs/install) the Google Cloud CLI, or you\ncan use [Cloud Shell](/shell/docs/using-cloud-shell).\n\nUse the [`gcloud alloydb backups create`](/sdk/gcloud/reference/alloydb/backups/create) command to create an on-demand backup. \n\n```\ngcloud alloydb backups create BACKUP_ID \\\n --cluster=CLUSTER_ID \\\n --region=REGION_ID \\\n --project=PROJECT_ID \\\n --async\n```\n\nThis command returns an operation, whose status you can query using the [`gcloud alloydb operations describe`](/sdk/gcloud/reference/alloydb/operations/describe) command. \n\n```\ngcloud alloydb operations describe OPERATION_ID \\\n --region=REGION_ID \\\n --project=PROJECT_ID\n```\n\n- \u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e: The ID for the backup to create. \n To create a backup in a [cross-region location](/alloydb/docs/backup/overview#cross-region-backup-location) using the gcloud CLI, replace with the full backup path in the following format: \n `projects/`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e`/backups/`\u003cvar translate=\"no\"\u003eBACKUP_ID\u003c/var\u003e \n | Cross-region backups require gcloud CLI version 484.0.0 or higher.\n- \u003cvar translate=\"no\"\u003eCLUSTER_ID\u003c/var\u003e: The ID of the cluster you want to back up.\n- \u003cvar translate=\"no\"\u003eREGION_ID\u003c/var\u003e: The ID of the region where the cluster is placed.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The ID of the project where the cluster is placed.\n\nIf you want to encrypt this backup using a [customer-managed encryption key (CMEK)](/alloydb/docs/cmek)\ninstead of the default Google-managed encryption, then you must provide these additional arguments:\n\n- `--kms-key=`\u003cvar translate=\"no\"\u003eKEY_ID\u003c/var\u003e: The ID of the CMEK key to use.\n- `--kms-keyring=`\u003cvar translate=\"no\"\u003eKEYRING_ID\u003c/var\u003e: The ID of the key's keyring.\n- `--kms-location=`\u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: The ID of that keyring's region. Note that it must match the cluster's region.\n- `--kms-project=`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The keyring's project ID.\n\n| Using CMEK with AlloyDB requires some additional setup. For more information, see [Using CMEK with\n| AlloyDB](/alloydb/docs/use-cmek).\n\nWhen you run this command, AlloyDB checks that the source\ncluster is the \"Ready\" state, starts a long-running operation to perform the\nbackup, and displays information about the long-running operation.\n\nYou can track completion of the long-running operation using the\n`operations describe` command: \n\n```\ngcloud alloydb operations describe OPERATION_ID \\\n --region=REGION_ID \\\n --project=PROJECT_ID\n```\n\n\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e: The operation ID reported when you ran the\n`backups create` command."]]