Soru

Zorluk: KolayManaging Storage and Database Solutions

A Cloud Engineer needs to manually export a Cloud SQL for PostgreSQL database to a Cloud Storage bucket for offline archiving using the Google Cloud CLI. Arrange the steps in the correct procedural order to successfully complete this export operation.

  1. 1Create a destination Cloud Storage bucket to hold the database export file.
  2. 2Grant the Cloud SQL instance service account storage write permissions on the Cloud Storage bucket.
  3. 3Execute the `gcloud sql export sql` command specifying the database instance, database name, and Cloud Storage URI.
  4. 4Verify that the exported dump file exists in the target Cloud Storage bucket.

Cevap

The correct sequence of steps is: 1) Create a destination Cloud Storage bucket, 2) Grant the Cloud SQL instance service account storage write permissions on the bucket, 3) Execute the gcloud sql export sql command, and 4) Verify that the exported dump file exists in the target bucket.
To export a Cloud SQL database to Google Cloud Storage, you must first ensure the target bucket exists. Next, you must grant the Cloud SQL instance's automatically created service account appropriate IAM write permissions on that bucket. After IAM permissions are established, you issue the `gcloud sql export sql` command. Finally, you confirm the operation's success by checking for the exported file in the Cloud Storage bucket.

Adım Adım Çözüm

1
Create the destination Cloud Storage bucket.
A target Cloud Storage bucket is available to store the exported file.
The export target URI must point to an existing Cloud Storage location.
2
Grant write access to the Cloud SQL service account.
The Cloud SQL instance service account has permission to write objects to the bucket.
Without IAM permissions (such as Storage Object Admin or Storage Object Creator) assigned to the service account, the export operation will fail with a permission denied error.
3
Run the export command via gcloud CLI.
Cloud SQL dumps the database content and uploads it to the specified Cloud Storage URI.
Executing the `gcloud sql export sql` command starts the official export operation.
4
Verify file existence in Cloud Storage.
Confirmation that the export completed and the file was written to GCS.
Operational management requires validating that backup and export artifacts are intact.

Anahtar Kavram

Exporting Cloud SQL Databases to Cloud Storage
Bu soruyu puanla