This guide shows you how to use Filestore instance replication.
Before you begin
Complete the setup steps needed to use Filestore. Quota for instances varies by project, region, and tier. Ensure you have enough to complete these tasks. For more information, see Quotas or Request a quota increase.
If you haven't already done so, create a Filestore instance. In the context of this guide, this is the source instance.
Create an instance replica
Google Cloud console
In the Google Cloud console, go to the Filestore Instances page.
Click the instance ID of the instance you want to replicate.
Click the Replications tab.
Click Create replica.
Click the documentation link to review the supported recovery point objective (RPO) and click Next.
Enter all required fields and optional fields as needed.
- The specified capacity must be greater than or equal to the source.
- The following specifications must match the source instance:
- Service tier, including capacity range
- Filestore protocol
- For reduced risk of data loss, you are encouraged to choose a region and zone unique to the source.
Click Next.
Review the details and click Next.
Click Create.
Wait for the operation to complete. When finished, the replica will be listed under the source instance on the Instances page.
Click the replica's instance ID to view its details.
gcloud
You can create a replica instance by running the
filestore instances createcommand.gcloud filestore instances create INSTANCE_ID \ --source-instance=projects/PROJECT_ID/locations/LOCATION/instances/SOURCE_INSTANCE \ --project=PROJECT_ID \ --location=LOCATION \ --network=name="NETWORK" \ --tier=TIER \ --file-share=name="FILE_SHARE_NAME",capacity=FILE_SHARE_SIZE \
Where:
- INSTANCE_ID with the name of the instance that you want
to create, such as
my-replica. - SOURCE_INSTANCE with the name and location of the source instance
for which you want to create a replica. For example,
projects/my-genomics-project/locations/us-east1-b/instances/my-genomics-instance. - PROJECT_ID with the project ID of the Google Cloud project where the source instance is located.
- LOCATION with the location where you want the replica
instance to reside, such as
us-central1-a. If the source is in a zonal service tier, you must specify both a region and zone for the replica. - NETWORK with the name of the network you want to use, such as
default. - TIER with the service tier you
need, such as
ZONAL. The tier and capacity range must match the source. - FILE_SHARE_NAME with the name you specify for the NFS file share
that is served from the instance, such as
vol1. - FILE_SHARE_SIZE with the size you want for the file share, such
as
1.25TiB.
REST API
Have gcloud CLI installed and initialized, which lets you generate an access token for the
Authorizationheader.Use
cURLto call the Filestore API:curl -s \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header "Content-Type: application/json" \ -d '{"tier": "TIER", "networks": { "network": "NETWORK" }, "file_shares": {"name": "SHARE_NAME","capacity_gb": "CAPACITY"}, "replication": {"replicas":[{"peer_instance": "projects/PROJECT/locations/ACTIVE_LOCATION/instances/ACTIVE_NAME"}], "role":"standby"}, "description": "DESCRIPTION" }' \ "https://file.googleapis.com/v1beta1/projects/PROJECT/locations/REPLICA_LOCATION/instances?instanceId=REPLICA_INSTANCE_NAME"Where:
TIERis the name of the service tier you want to use for the replica. For example,REGIONAL.NETWORKis the name of the network you want to use for the replica. For example,default. You must use the same network as the source.SHARE_NAMEis the name of the file share. For example,vol1.CAPACITYis the size, in GiB, you want to allocate for the replica. For example,1024. Capacity must be greater than or equal to that of the source instance.PROJECTis the name of the project where your replica will reside. For example,my-genomics-project. The source and replica must be located in the same project.ACTIVE_LOCATIONis the location where the source resides. For example,us-east1.ACTIVE_NAMEis the name of the instance you want to replicate. For example,my-genomics-instance.DESCRIPTIONis a description of the replica instance you want to create. For example,My genomics replica.REPLICA_LOCATIONis the location where you want the replica to reside. For example,us-central1.REPLICA_INSTANCE_NAMEis the name of the replica instance you want to create. For example,my-genomics-replica.
View replica status
Google Cloud console
In the Google Cloud console, go to the Filestore Instances page.