Stay organized with collections Save and categorize content based on your preferences.
MySQL | PostgreSQL | SQL ServerPreview
This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of the Service Specific Terms. You can process personal data for this feature as outlined in the Cloud Data Processing Addendum, subject to the obligations and restrictions described in the agreement under which you access Google Cloud. Pre-GA features are available "as is" and might have limited support. For more information, see the launch stage descriptions.
This page describes how to create and manage read pools for your large read workloads.
Before you begingcloud --project=PROJECT \ sql users set-password root --host=% \ --instance=PRIMARY_INSTANCE_NAME --prompt-for-passwordMake sure you're using
gcloud
v516.0.0 or later.
Make the following replacements:
For information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud beta sql instances create
command to create a read pool with multiple read pool nodes:
gcloud beta sql instances create READ_POOL_NAME \ --tier=TIER --edition=ENTERPRISE_PLUS \ --instance-type=READ_POOL_INSTANCE --node-count=NODE_COUNT \ --master-instance-name=PRIMARY_INSTANCE_NAME
Make the following replacements:
db-perf-optimized-N-4
.1
to 20
.my-primary-instance
.Use the insert
method of the instances resource to create a read pool with multiple read pool nodes. The databaseVersion
property must be the same as the primary.
Before using any of the request data, make the following replacements:
us-east1
. The region must be the same as the primary instance.db-perf-optimized-N-4
.my-read-pool
.POSTGRES_16
.1
to 20
.projects/vpc-host-project/global/networks/my-network-name
.HTTP method and URL:
POST https://sqladmin.googleapis.com/v1/projects/PROJECT/instances
Request JSON body:
{ "name": "READ_POOL_NAME", "masterInstanceName": "PRIMARY_INSTANCE_NAME", "project": "PROJECT", "databaseVersion": "DATABASE_VERSION", "region": "REGION", "instanceType": "READ_POOL_INSTANCE", "nodeCount": NODE_COUNT, "settings": { "tier": "TIER", "edition": "ENTERPRISE_PLUS", "ipConfiguration": { "ipv4Enabled": false, "privateNetwork": "FULL_NETWORK_NAME" } } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X POST \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "CREATE_READ_POOL", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }REST v1beta4
Use the insert
method of the instances resource to create a read pool with multiple read pool nodes. The databaseVersion
property must be the same as the primary.
Before using any of the request data, make the following replacements:
us-east1
. The region must be the same as the primary instance.db-perf-optimized-N-4
.my-read-pool
.POSTGRES_16
.1
to 20
.projects/vpc-host-project/global/networks/my-network-name
.HTTP method and URL:
POST https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances
Request JSON body:
{ "name": "READ_POOL_NAME", "masterInstanceName": "PRIMARY_INSTANCE_NAME", "project": "PROJECT", "databaseVersion": "DATABASE_VERSION", "region": "REGION", "instanceType": "READ_POOL_INSTANCE", "nodeCount": NODE_COUNT, "settings": { "tier": "TIER", "edition": "ENTERPRISE_PLUS", "ipConfiguration": { "ipv4Enabled": false, "privateNetwork": "FULL_NETWORK_NAME" } } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X POST \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "CREATE_READ_POOL", "name": "OPERATION_ID", "targetId": "INSTANCE_ID", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }Convert a read replica to a read pool
You can convert an existing Cloud SQL Enterprise Plus edition read replica into a read pool by specifying the number of nodes in the pool. During this conversion process, the replica IP will become the read pool IP (the read endpoint), so existing clients can connect to the pool without reconfiguration.
The newly created read pool nodes will have the same machine type and configuration as the original read replica. Changing this machine type or configuration requires a separate operation. This operation is only supported for zonal read replicas. To convert a highly available (HA) read replica to a read pool, you must first convert it to a zonal read replica.
For more information, see Edit read pool configuration.
gcloudFor information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud beta sql instances patch
command to convert a read replica for use with a read pool:
gcloud beta sql instances patch READ_REPLICA_NAME \ --instance-type=READ_POOL_INSTANCE --node-count=NODE_COUNT
Make the following replacements:
1
to 20
.Use the patch
method of the instances resource to convert a read replica to a read pool.
Before using any of the request data, make the following replacements:
my-read-replica
.1
to 20
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_REPLICA_NAME
Request JSON body:
{ "instanceType": "READ_POOL_INSTANCE", "nodeCount": NODE_COUNT }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_REPLICA_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_REPLICA_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_REPLICA_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_REPLICA_NAME", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }REST v1beta4
Use the patch
method of the instances resource to convert a read replica to a read pool.
Before using any of the request data, make the following replacements:
my-read-replica
.1
to 20
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_REPLICA_NAME
Request JSON body:
{ "instanceType": "READ_POOL_INSTANCE", "nodeCount": NODE_COUNT }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_REPLICA_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_REPLICA_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_REPLICA_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_REPLICA_NAME", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }Convert a read pool to a read replica gcloud
For information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud beta sql instances patch
command to convert a read replica for use with a read pool:
gcloud beta sql instances patch READ_POOL_NAME \ --instance-type=READ_REPLICA_INSTANCE
Make the following replacements:
Use the patch
method of the instances resource to convert a read pool to a read replica.
Before using any of the request data, make the following replacements:
my-read-pool
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME
Request JSON body:
{ "instanceType": "READ_REPLICA_INSTANCE" }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }REST v1beta4
Use the patch
method of the instances resource to convert a read pool to a read replica.
Before using any of the request data, make the following replacements:
my-read-pool
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME
Request JSON body:
{ "instanceType": "READ_REPLICA_INSTANCE" }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }View read pool information gcloud
For information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud beta sql instances describe
command to describe the read pool:
gcloud beta sql instances describe READ_POOL_NAME
Make the following replacements:
An example response with IP address and node information, might look similar to the following:
... connectionName: my-project:us-central1:read-pool ipAddresses: - ipAddress: 10.3.0.108 type: PRIVATE nodeCount: 2 nodes: - dnsName: c5bdacb09ffc.j10o8yqc7pve.us-central1.sql.goog. gceZone: us-central1-f ipAddresses: - ipAddress: 10.3.0.112 type: PRIVATE name: read-pool-node-01 state: RUNNABLE - dnsName: 8f77c454d6b2.j10o8yqc7pve.us-central1.sql.goog. gceZone: us-central1-c ipAddresses: - ipAddress: 10.3.0.113 type: PRIVATE name: read-pool-node-02 state: RUNNABLEREST v1
Use the get
method to view read pool details.
Before using any of the request data, make the following replacements:
my-read-pool
.HTTP method and URL:
GET https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X GET \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ [...], "connectionName": "my-project:us-central1:read-pool", "ipAddresses": [ { "type": "PRIVATE", "ipAddress": "10.3.0.108" } ], "nodeCount": 2, "nodes": [ { "ipAddresses": [ { "type": "PRIVATE", "ipAddress": "10.3.0.112" } ], "name": "read-pool-node-01", "gceZone": "us-central1-f", "dnsName": "c5bdacb09ffc.j10o8yqc7pve.us-central1.sql.goog.", "state": "RUNNABLE" }, { "ipAddresses": [ { "type": "PRIVATE", "ipAddress": "10.3.0.113" } ], "name": "read-pool-node-02", "gceZone": "us-central1-c", "dnsName": "8f77c454d6b2.j10o8yqc7pve.us-central1.sql.goog.", "state": "RUNNABLE" } ] }REST v1beta4
Use the get
method to view read pool details.
Before using any of the request data, make the following replacements:
my-read-pool
.HTTP method and URL:
GET https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X GET \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ [...], "connectionName": "my-project:us-central1:read-pool", "ipAddresses": [ { "type": "PRIVATE", "ipAddress": "10.3.0.108" } ], "nodeCount": 2, "nodes": [ { "ipAddresses": [ { "type": "PRIVATE", "ipAddress": "10.3.0.112" } ], "name": "read-pool-node-01", "gceZone": "us-central1-f", "dnsName": "c5bdacb09ffc.j10o8yqc7pve.us-central1.sql.goog.", "state": "RUNNABLE" }, { "ipAddresses": [ { "type": "PRIVATE", "ipAddress": "10.3.0.113" } ], "name": "read-pool-node-02", "gceZone": "us-central1-c", "dnsName": "8f77c454d6b2.j10o8yqc7pve.us-central1.sql.goog.", "state": "RUNNABLE" } ] }Add or remove read pool nodes
The following steps scale a read pool in or out by modifying the number of read pool nodes in the read pool. Some operation limitations apply. For more information, see Read pool limitations.
gcloudFor information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud beta sql instances patch
command to scale the read pool:
gcloud beta sql instances patch READ_POOL_NAME \ --node-count=NODE_COUNT
Make the following replacements:
1
to 20
.Use the patch
method to scale a read pool in or out by modifying the number of read pool nodes in the read pool.
Before using any of the request data, make the following replacements:
1
to 20
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME
Request JSON body:
{ "nodeCount": NODE_COUNT }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }REST v1beta4
Use the patch
method to scale a read pool in or out by modifying the number of read pool nodes in the read pool.
Before using any of the request data, make the following replacements:
1
to 20
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME
Request JSON body:
{ "nodeCount": NODE_COUNT }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAMEINSTANCE_ID", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }Edit read pool configuration
The following steps show you how to edit read pool configuration. For more detailed information, see About instance settings and Edit instances.
gcloudFor information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud beta sql instances patch
command to vertically scale the read pool, for example, by modifying the machine type:
gcloud beta sql instances patch READ_POOL_NAME \ --tier=TIER
Make the following replacements:
db-perf-optimized-N-8
.Use the patch
method to modify read pool node configuration. Settings are uniformly applied across all read pool nodes in the read pool.
Before using any of the request data, make the following replacements:
db-perf-optimized-N-4
.my-read-pool
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME
Request JSON body:
{ "settings": { "tier": "TIER" } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }REST v1beta4
Use the patch
method to modify read pool node configuration. Settings are uniformly applied across all read pool nodes in the read pool.
Before using any of the request data, make the following replacements:
db-perf-optimized-N-4
.my-read-pool
.HTTP method and URL:
PATCH https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME
Request JSON body:
{ "settings": { "tier": "TIER" } }
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
curl -X PATCH \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Save the request body in a file named request.json
, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "UPDATE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }Connect to a read pool
There are many ways to connect to a read pool. The following steps show one way, namely, connecting to a read pool with a private IP address by creating a VM in the same VPC network to serve as the connection source.
For more information about other ways you can configure connectivity to a Cloud SQL instance, see About Cloud SQL connections. The connection methods usually require you to first obtain the IP address or connection name of the instance, as described in View read pool information. Read pools support most of the connection methods available for other Cloud SQL instances, with some limitations.
If connecting using the Cloud SQL Auth Proxy or the Cloud SQL Connectors, make sure to update to the latest version. For read pool support, the minimum required versions include the following:
For information about installing and getting started with the gcloud CLI, see Install the gcloud CLI. For information about starting Cloud Shell, see Use Cloud Shell.
Use the following gcloud sql instances delete
command to delete a read pool:
gcloud sql instances delete READ_POOL_NAME
Make the following replacements:
Use the delete
method to delete a read pool.
Before using any of the request data, make the following replacements:
my-read-pool
.HTTP method and URL:
DELETE https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X DELETE \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "DELETE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/v1/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }REST v1beta4
Use the delete
method to delete a read pool.
Before using any of the request data, make the following replacements:
my-read-pool
.HTTP method and URL:
DELETE https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell) Note: The following command assumes that you have logged in to thegcloud
CLI with your user account by running gcloud init
or gcloud auth login
, or by using Cloud Shell, which automatically logs you into the gcloud
CLI . You can check the currently active account by running gcloud auth list
.
Execute the following command:
curl -X DELETE \PowerShell (Windows) Note: The following command assumes that you have logged in to the
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME"
gcloud
CLI with your user account by running gcloud init
or gcloud auth login
. You can check the currently active account by running gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
Response{ "kind": "sql#operation", "targetLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/instances/READ_POOL_NAME", "status": "PENDING", "user": "user@example.com", "insertTime": "2020-01-21T22:43:37.981Z", "operationType": "DELETE", "name": "OPERATION_ID", "targetId": "READ_POOL_NAME", "selfLink": "https://sqladmin.googleapis.com/sql/v1beta4/projects/PROJECT/operations/OPERATION_ID", "targetProject": "PROJECT" }What's next
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-14 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4