This page describes how to restart the primary instance, a read pool instance, or a node in a read pool of an AlloyDB cluster.
When you initiate a restart of an instance, it disrupts all connections that are available on the instance, the instance restarts, and is ready to accept new connections.
Restarting an instance does not change the private IP address of the instance.
Before you begin
- The Google Cloud project you are using must have been enabled to access AlloyDB.
- You must have one of these IAM roles in the Google Cloud project you are using:
roles/alloydb.admin
(the AlloyDB Admin predefined IAM role)roles/owner
(the Owner basic IAM role)roles/editor
(the Editor basic IAM role)
If you don't have any of these roles, contact your Organization Administrator to request access.
Restart an instance
Console
- In the Google Cloud console, go to the Clusters page.
- Click a cluster in the Resource Name column.
- In the Overview page, go to the Instances in your cluster section, choose the primary or a read pool instance, and click Restart.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
Restart the instance:
gcloud alloydb instances restart INSTANCE_ID \ --cluster=CLUSTER_ID \ --region=REGION_ID \ --project=PROJECT_ID \ [--async]
- INSTANCE_ID: the ID of the instance.
- CLUSTER_ID: the ID of the cluster where the instance is available.
- REGION_ID: the region where the instance is placed.
- PROJECT_ID: the ID of the project where the cluster is placed.
async
: an optional flag to return immediately, without waiting for the operation in progress to complete.
Restart specific nodes of a read pool
You can use the gcloud CLI to restart one or more nodes of a read pool.
The following command shows how you can restart a node of a read pool:
gcloud alloydb instances restart INSTANCE_ID \ --cluster=CLUSTER_ID \ --region=REGION_ID \ --node-ids=NODE_ID \
- INSTANCE_ID: the ID of the readpool instance.
- CLUSTER_ID: the ID of the cluster where the instance is available.
- NODE_ID: the ID that needs a restart.
- PROJECT_ID: the ID of the project where the cluster is placed.
--async
: an optional flag to return immediately, without waiting for the operation in progress to complete.
The following example shows how you can restart multiple nodes:
gcloud alloydb instances restart INSTANCE_ID \ --cluster=CLUSTER_ID \ --region=REGION_ID \ --node-ids=NODE_ID1,NODE_ID2 \
- INSTANCE_ID: the ID of the readpool instance.
- CLUSTER_ID: the ID of the cluster where the instance is available.
- NODE_ID1,NODE_ID2: the list of nodes that need a restart.
- PROJECT_ID: the ID of the project where the cluster is placed.
--async
: an optional flag to return immediately, without waiting for the operation in progress to complete.