Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, descrevemos como criar um backup sob demanda dos dados de um cluster do AlloyDB.
Ao criar um backup sob demanda, o AlloyDB verifica se o cluster que você está fazendo backup e a instância principal dele estão no estado "Pronto". Em seguida, ele inicia uma operação de longa duração para realizar o backup dos dados do cluster.
Selecione Chave de criptografia gerenciada pelo cliente (CMEK).
Selecione uma chave gerenciada pelo cliente no menu que aparece.
O console Google Cloud limita essa lista a chaves no mesmo projeto Google Cloud e região do novo cluster. Para usar uma chave que não está nessa lista, clique em
Não encontra sua chave? Insira o nome do recurso da chave e digite o nome do recurso da chave na caixa de diálogo resultante.
O uso da CMEK com o AlloyDB exige
algumas configurações adicionais. Para mais informações, consulte Como usar a CMEK com o
AlloyDB.
Clique em Criar.
O AlloyDB verifica se o cluster de origem está no estado "Pronto" e inicia uma operação de longa duração para realizar o backup. A página Backups mostra o backup com o status "Em andamento" até que a operação seja concluída.
BACKUP_ID: o ID do backup a ser criado.
Para criar um backup em um local entre regiões usando a CLI gcloud, substitua pelo caminho completo
do backup no seguinte formato: projects/PROJECT_ID/locations/REGION_ID/backups/BACKUP_ID
CLUSTER_ID: o ID do cluster que você quer fazer backup.
REGION_ID: o ID da região em que o cluster está localizado.
PROJECT_ID: o ID do projeto em que o cluster está localizado.
--kms-keyring=KEYRING_ID: o ID do keyring da chave.
--kms-location=LOCATION_ID: o ID da região do keyring. Ela precisa corresponder à região do cluster.
--kms-project=PROJECT_ID: o ID do projeto do keyring.
Ao executar esse comando, o AlloyDB verifica se o cluster de origem está no estado "Pronto", inicia uma operação de longa duração para realizar o backup e mostra informações sobre essa operação.
É possível acompanhar a conclusão da operação de longa duração usando o
comando operations describe:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-25 UTC."],[[["\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."]]