This page shows you how to perform the following actions related to AlloyDB for PostgreSQL cluster maintenance:
- Set, view, and clear a maintenance window for your primary and secondary cluster.
- View upcoming maintenance events scheduled for your primary and secondary cluster.
For an overview of how maintenance works with AlloyDB clusters, see About maintenance.
Set a maintenance window on a cluster
Console
Go to the Clusters page.
Click a cluster in the Resource Name column.
In the Overview page, in Maintenance, click Edit.
In Maintenance window, select the day of the week for this maintenance window.
The default option is Any window. When you create a cluster, the cluster is assigned this default maintenance window.
Select the hour of the day for this maintenance window.
Click Update to save the changes.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
To set a maintenance window on a cluster, run the gcloud clusters update
command with the
--maintenance-window-day
and --maintenance-window-hour
flags:
gcloud alloydb clusters update CLUSTER_ID \
--region REGION \
--maintenance-window-day DAY_OF_WEEK \
--maintenance-window-hour HOUR_OF_DAY
Replace the following:
CLUSTER_ID
: the cluster to set the maintenance window on.REGION
: the Google Cloud region that this cluster is located in—for example,us-central1
.DAY_OF_WEEK
: the day of the week, in the UTC time zone, for this maintenance window. Valid values areMONDAY
,TUESDAY
,WEDNESDAY
,THURSDAY
,FRIDAY
,SATURDAY
, andSUNDAY
.The default value is Any window. When you create a cluster, the cluster is assigned this default maintenance window.
HOUR_OF_DAY
: an integer between0
and23
representing the hour of the day, in the UTC time zone, for this maintenance window.
If you make changes to your maintenance window setting while the cluster is already undergoing maintenance or is scheduled for maintenance, then the changes don't take effect until after the current or scheduled maintenance is complete.
Clear a maintenance window
Console
Go to the Clusters page.
Click a cluster in the Resource Name column.
In the Overview page, in Maintenance, click Edit.
In Maintenance window, select Any window.
Click Update to save the changes.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
To clear the maintenance window from a cluster, run the gcloud clusters
update
command with the
--maintenance-window-any
flag:
gcloud alloydb clusters update CLUSTER_ID \
--region REGION \
--maintenance-window-any
Replace the following:
CLUSTER_ID
: the cluster to set the maintenance window on.REGION
: the Google Cloud region that this cluster is located in—for example,us-central1
.
View the maintenance window of a cluster
Console
Go to the Clusters page.
Click a cluster in the Resource Name column.
In the Overview page, in Maintenance, view the maintenance window details for your cluster.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
To review the current maintenance window on a cluster, run the gcloud alloydb
clusters describe
command:
gcloud alloydb clusters describe CLUSTER_ID \
--region REGION
Replace the following:
CLUSTER_ID
: the cluster to set the maintenance window on.REGION
: the Google Cloud region that this cluster is located in—for example,us-central1
.
If the cluster has a maintenance window set, then the output of the command includes lines that resemble the following:
maintenanceUpdatePolicy:
maintenanceWindows:
- day: TUESDAY
startTime:
hours: 23
If the output doesn't include a maintenanceUpdatePolicy
section, then the
cluster has no maintenance window set.
View upcoming maintenance on a cluster
Console
Go to the Clusters page.
Locate your cluster, and view the Maintenance column for information about the upcoming maintenance window.
gcloud
To use the gcloud CLI, you can install and initialize the Google Cloud CLI, or you can use Cloud Shell.
To see upcoming maintenance planned for a cluster that has a maintenance
window set, run the gcloud clusters
describe
command:
gcloud alloydb clusters describe CLUSTER_ID \
--region REGION
Replace the following:
CLUSTER_ID
: the cluster to set the maintenance window on.REGION
: the Google Cloud region that this cluster is located in—for example,us-central1
.
If the cluster has a planned maintenance event in its future, then the output of the command includes lines that resemble the following:
maintenanceSchedule:
startTime: 2024-07-03T09:46:40Z
The UTC-formatted timestamp specifies the moment at which AlloyDB plans to start updating the system software of all of the nodes in this cluster.
Opt in to maintenance notifications
To receive an automated email notification whenever a maintenance event is scheduled or canceled for a cluster that has a maintenance window set, use the Google Cloud console to opt in to receiving these messages:
Go to the Clusters page.
Click a cluster in the Resource Name column.
In the Overview page, in Maintenance, click Edit in the
Notifications:
row.Click Communication.
In the row for AlloyDB, Maintenance window, select the toggle in the Email column.
Each user that needs to receive notifications must opt in separately.