Stopping a database cluster pauses the cluster to save resources. You can stop and start database clusters with the Google Distributed Cloud (GDC) air-gapped console or with the gdcloud CLI tool.
Console
- From the main menu of the GDC console, choose Database Service.
- Select the database cluster to start or stop.
- Click STOP or START.
gdcloud CLI
Use the following command to stop a database cluster:
gdcloud database clusters stop CLUSTER_NAME
Use the following command to start a database cluster:
gdcloud database clusters start CLUSTER_NAME
Replace the following:
- CLUSTER_NAME with the name of the database cluster to start or stop.
API
kubectl patch dbcluster.DBENGINE_NAME.dbadmin.gdc.goog DBCLUSTER_NAME -p '{"spec":{"primarySpec": {"isStopped": IS_STOPPED}}}' --type=merge -n USER_PROJECT
Replace the following variables:
DBENGINE_NAME
, the name of the database engine. This is one ofalloydbomni
,postgresql
, ororacle
.DBCLUSTER_NAME
, the name of the database cluster.USER_PROJECT
, the name of the user project where the database cluster was created.IS_STOPPED
to indicate whether the database cluster should be stopped (true
) or not (false
).