This page describes how to use the turbo replication feature on a dual-region bucket.
Required roles
In order to get the required permissions for using turbo replication, ask your
administrator to grant you the Storage Admin
(roles/storage.admin
) IAM role on the bucket.
This predefined role contains the permissions required to use turbo replication. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
storage.buckets.get
storage.buckets.update
storage.buckets.list
- This permission is only required if you plan on using the Google Cloud console to perform the instructions on this page.
You might also be able to get these permissions with custom roles or other predefined roles.
For instructions on granting roles on buckets, see Use IAM with buckets.
Set turbo replication
To enable or disable turbo replication on an existing bucket, complete the following instructions:
Console
- In the Google Cloud console, go to the Cloud Storage Buckets page.
In the bucket list, click the name of the desired bucket.
Click the Configuration tab.
In the Replication row, click
Edit.The window that appears indicates whether you are about to Enable turbo replication or Disable turbo replication.
Click Save to confirm the new setting.
Command line
Use the gcloud storage buckets update
command with the --rpo
flag:
gcloud storage buckets update gs://BUCKET_NAME --rpo=STATE
Where:
BUCKET_NAME
is the name of the relevant bucket. For example,my-bucket
.STATE
isASYNC_TURBO
for enabling Turbo Replication orDEFAULT
for disabling Turbo Replication.
If successful, the response looks like:
Updating gs://my-bucket/... Completed 1
Client libraries
For more information, see the
Cloud Storage C++ API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage C# API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage Go API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage Java API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage Node.js API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage PHP API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage Python API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:
For more information, see the
Cloud Storage Ruby API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
The following sample enables turbo replication on a bucket: The following sample enables default replication on a bucket:C++
C#
Go
Java
Node.js
PHP
Python
Ruby
REST APIs
JSON API
Have gcloud CLI installed and initialized, which lets you generate an access token for the
Authorization
header.Create a JSON file that contains the following information:
{ "rpo": "STATE" }
Where
STATE
isASYNC_TURBO
for enabling Turbo Replication orDEFAULT
for disabling Turbo Replication.Use
cURL
to call the JSON API with aPATCH
Bucket request:curl -X PATCH --data-binary @JSON_FILE_NAME \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://storage.googleapis.com/storage/v1/b/BUCKET_NAME?fields=rpo"
Where:
JSON_FILE_NAME
is the path for the JSON file that you created in Step 2.BUCKET_NAME
is the name of the relevant bucket. For example,my-bucket
.
If the request is successful, no response is returned.
XML API
This feature cannot be managed through the XML API. Use the JSON API instead.
Check a bucket's replication status
To check the recovery point objective (RPO) or replication status of a bucket, complete the following instructions:
Console
- In the Google Cloud console, go to the Cloud Storage Buckets page.
In the bucket list, click the name of the bucket you want to verify.
Click the Configuration tab.
If turbo replication is enabled on the bucket, Replication is set to Turbo.
Command line
Use the gcloud storage buckets describe
command with the
--format
flag:
gcloud storage buckets describe gs://BUCKET_NAME --format="default(rpo)"
Where:
BUCKET_NAME
is the name of the relevant bucket. For example,my-bucket
.
If successful, the response looks like the following example:
rpo: ASYNC_TURBO
Client libraries
For more information, see the
Cloud Storage C++ API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage C# API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage Go API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage Java API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage Node.js API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage PHP API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage Python API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
For more information, see the
Cloud Storage Ruby API
reference documentation.
To authenticate to Cloud Storage, set up Application Default Credentials.
For more information, see
Set up authentication for a local development environment.
C++
C#
Go
Java
Node.js
PHP
Python
Ruby
REST APIs
JSON API
Have gcloud CLI installed and initialized, which lets you generate an access token for the
Authorization
header.Use
cURL
to call the JSON API with aGET
Bucket request:curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://storage.googleapis.com/storage/v1/b/BUCKET_NAME?fields=rpo"
Where
BUCKET_NAME
is the name of the relevant bucket. For example,my-bucket
.The response looks like the following example:
{ "name": "my-bucket", "projectNumber": "234...", ... "rpo": "ASYNC_TURBO" }
Notice the
rpo
key. The valueASYNC_TURBO
indicates that turbo replication is enabled.DEFAULT
indicates that default replication is applied. Therpo
field is always present for dual- and multi-region buckets, but is absent from single-region buckets.
XML API
This feature cannot be managed through the XML API. Use the JSON API instead.
What's next
- Learn more about turbo replication.
- Learn more about turbo replication pricing.
- Learn about metrics that monitor your bucket's performance, including replication performance.
- Learn how Cloud Monitoring alerting can be used to create altering policies based on specified metrics and manage notifications associated with them.