> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage a CockroachDB Advanced Cluster

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

This page describes the cluster management and cluster deletion workflows for CockroachDB Advanced.

## Planning your cluster

Before making any changes to your cluster's nodes or regions, review the <InternalLink path="plan-your-cluster">requirements and recommendations</InternalLink> for CockroachDB Cloud cluster configuration.

## View Clusters page

On [logging in to the CockroachDB Cloud Console](https://cockroachlabs.cloud/), the **Clusters** page is displayed. The **Clusters** page provides a high-level view of your clusters.

To view and manage a specific cluster, click the name of the cluster. The [**Overview**](#view-cluster-overview) page will display.

## View cluster overview

The <InternalLink version="cockroachcloud" path="overview-page">**Overview** page</InternalLink> displays details about the selected CockroachDB Cloud cluster.

Click the **Connect** button to get client connection details for your cluster. For more information, see <InternalLink version="cockroachcloud" path="connect-to-an-advanced-cluster">Connect to Your CockroachDB Advanced Cluster</InternalLink>.

## Edit labels

You can <InternalLink path="labels">organize CockroachDB Cloud clusters using labels</InternalLink>.

## Scale your cluster

These sections show how to scale a Advanced cluster horizontally by adding or removing nodes or vertically by changing each node's storage and compute resources.

### Add or remove nodes from a cluster

You can add or remove nodes from your cluster through the Console. See <InternalLink path="plan-your-cluster">Planning your cluster</InternalLink> for cluster requirements and recommendations before proceeding.

<Danger>
  Do not add nodes if your cluster's disks are nearly full. Adding nodes triggers rebalancing that can temporarily increase disk usage and worsen disk pressure. Instead, increase storage per node to create headroom. Refer to [Increase storage for a cluster](#increase-storage-for-a-cluster).
</Danger>

<Note>
  You cannot scale a multi-node cluster down to a single-node cluster.
</Note>

To add or remove nodes from your cluster:

1. Navigate to the cluster's **Overview** page.
2. Click on **Settings** to expand the **Cluster settings** section, then click on **Edit** next to the cluster's **Regions**.

   The **Edit cluster** page displays.
3. On the **Regions** page, select the number of nodes you want in each region from the **Nodes** dropdown.
4. In the sidebar, verify the hourly estimated cost for the cluster.
5. Click **Next: Capacity** and then **Update cluster**.

### Change compute for a cluster

1. Click on the three-dots menu and select **Edit cluster**.

   The **Edit cluster** page displays.
2. Click on **Next: Capacity** to open the **Capacity** page.
3. In the **Compute per node** section, select the new amount of vCPUs per node.

<Note>
  When scaling up your cluster, it is generally more effective to increase node size up to 16 vCPUs before adding more nodes. For most production applications, we recommend **at least 4 to 8 vCPUs** per node. For new CockroachDB Cloud organizations created after September 26, 2024, a cluster must have at least 4 vCPUs per node.
</Note>

4. In the sidebar, verify the hourly estimated cost for the cluster.
5. Click **Next: Update cluster**.

### Increase storage for a cluster

<Danger>
  AWS disks can only be scaled once every six hours.
</Danger>

1. Click on the three-dots menu and select **Edit cluster**.

   The **Edit cluster** page displays.
2. In the **Storage per node** section, select the new amount of storage per node.

<Danger>
  Storage space cannot be removed due to cloud provider limitations.
</Danger>

3. In the sidebar, verify the hourly estimated cost for the cluster.
4. Click **Next: Update cluster**.

## Add or remove regions from a cluster

You can add or remove up to nine regions at a time through the Console. Note that you cannot have a two-region cluster, and it will take about 30 minutes to add or remove each region. See <InternalLink path="plan-your-cluster">Planning your cluster</InternalLink> for cluster requirements and recommendations before proceeding.

### Add a region to a cluster

You can add up to nine regions at a time through the Console. See <InternalLink path="plan-your-cluster">Planning your cluster</InternalLink> for cluster requirements and recommendations before proceeding.

1. Click on the three-dots menu and select **Edit cluster**.

   The **Edit cluster** page displays.
2. On the **Regions** page, click **Add a region**.

   For GCP, each region consumes a `/19` CIDR range from the CIDR range configured during cluster creation. If you add a region to a GCP cluster with <InternalLink path="network-authorization">VPC peering</InternalLink> enabled, the region's IP range will be populated automatically.
3. Select the desired new region and specify the number of nodes for it.
4. In the sidebar, verify the hourly estimated cost for the cluster.
5. Click **Next: Capacity** and then **Update cluster**.

### Remove a region from your cluster

When you remove a region from a <InternalLink path="plan-your-cluster-advanced#multi-region-clusters">multi-region</InternalLink> cluster, the node in that region with the highest ordinal will be <InternalLink version="stable" path="node-shutdown?filters=decommission#decommission-the-node">decommissioned</InternalLink> first. Any ranges on that node will be <InternalLink version="stable" path="ui-replication-dashboard#snapshot-data-received">up-replicated</InternalLink> to other nodes, and once decommission is complete that node will be shut down. This process is then repeated for every other node in the region.

<Note>
  If your <InternalLink version="stable" path="configure-replication-zones">zone configurations</InternalLink> are set to pin range replicas to a specific region, you cannot remove that region.
</Note>

To remove a region from your cluster:

1. Click on the three-dots menu and select **Edit cluster**.

   The **Edit cluster** page displays.
2. On the **Regions** page, click the **X** button next to each region you want to remove.

<Note>
  If you remove one region from a three-region cluster, CockroachDB Cloud will automatically reduce it to a single-region configuration by deleting two regions.
</Note>

3. In the sidebar, verify the hourly estimated cost for the cluster.
4. Click **Next: Capacity** and then **Update cluster**.

## Set a maintenance window

From your cluster's <InternalLink version="cockroachcloud" path="overview-page">**Overview** page</InternalLink>, you can view and manage the maintenance and <InternalLink path="upgrade-policy#patch-version-upgrades">patch upgrade</InternalLink> window for your cluster. During the window, your cluster may experience restarts, degraded performance, and downtime for single-node clusters. To help keep your clusters updated while minimizing disruptions, set a window of time when your cluster is experiencing the lowest traffic. If no maintenance window is set, your cluster will be automatically upgraded as soon as new patch versions are available, and other cluster maintenance occurs as needed. Refer to <InternalLink path="upgrade-policy">CockroachDB Cloud Upgrade Policy</InternalLink>.

Setting maintenance windows requires the <InternalLink path="authorization#cluster-admin">Cluster Admin</InternalLink> or <InternalLink path="authorization#cluster-operator">Cluster Operator</InternalLink> role.

<Note>
  Maintenance operations that are critical for cluster security or stability may be applied outside of the maintenance window, and upgrades that begin in a maintenance window may not always be completed by the end of the window.
</Note>

To set a maintenance window in the Cloud console:

1. On the **Overview** page, click **Settings** to open the **Cluster settings** panel.
2. Click the **Edit** button next to **Maintenance window**.
3. From the **Day** dropdown, select the day of the week during which maintenance may be applied.
4. From the **Start of window** dropdown, select a start time for your maintenance window in UTC.

   The window will last for 6 hours from the start time.
5. (Optional) If you want to delay automatic patch upgrades, switch **Delay patch upgrades** to **On**. You can set a deferral period of 30, 60, or 90 days after the patch is released.

   Enable this setting for production clusters to ensure that development and testing clusters are upgraded before production clusters. This setting applies only to patch upgrades and not to major version upgrades. The patch upgrade occurs during a maintenance window after the deferral period.

You can also configure maintenance windows and patch upgrade deferral periods using the <InternalLink path="cloud-api">Cloud API</InternalLink>.

## Restore data from a backup

Cockroach Labs automatically runs full managed backups daily and incremental backups hourly for every CockroachDB Advanced cluster. Full backups are retained for 30 days and incremental backups for 7 days. Refer to <InternalLink path="managed-backups">Use Managed Backups</InternalLink> for ways to restore data from your cluster's automatic backups in the Console.

Additionally, you can <InternalLink path="take-and-restore-self-managed-backups">back up and restore</InternalLink> your CockroachDB Advanced cluster manually. For detail on taking backups to your cloud storage, see <InternalLink path="take-and-restore-self-managed-backups">Take and Restore Self-Managed Backups</InternalLink>.

<Note>
  All databases are not backed up at the same time. Each database is backed up every hour based on the time of creation. For larger databases, you might see an hourly CPU spike while the database is being backed up.
</Note>

## Configure PCI ready features

CockroachDB Advanced advanced clusters have a **PCI DSS Ready** page in the CockroachDB Cloud Console to monitor the status of security features required for <InternalLink path="pci-dss">PCI readiness</InternalLink>. Feature statuses will update from **INACTIVE** to **ACTIVE** once you configure them. Learn more about configuring these features:

* <InternalLink path="cloud-org-audit-logs">CockroachDB Cloud Organization Audit logs</InternalLink>
* <InternalLink path="managing-cmek">Customer-Managed Encryption Keys (CMEK)</InternalLink>
* <InternalLink path="egress-perimeter-controls">Egress Perimeter Controls</InternalLink>
* Single Sign-On (SSO) for your <InternalLink path="configure-cloud-org-sso">CockroachDB Cloud organization</InternalLink> and your <InternalLink path="cloud-sso-sql">clusters</InternalLink>
* <InternalLink path="network-authorization">Network security</InternalLink>

## Enable deletion protection

To help prevent a cluster from being deleted by mistake, you can enable *deletion protection*. Before you can delete a cluster with deletion protection enabled, you must disable deletion protection. A user with permission to delete a cluster can enable deletion protection on the same cluster.

1. Navigate to the **Overview** page for the cluster you want to protect.
2. Click on **Settings** to open the **Cluster settings** panel.
3. If deletion protection is off, click **Edit**. Toggle the setting, then click **Save**.

## Delete cluster

<Danger>
  Deleting a cluster will delete all cluster data. Deleted clusters can not be restored.
</Danger>

<Note>
  You will only be billed for a CockroachDB Advanced cluster while it is running. You can delete a cluster at any time to stop charges from accumulating.
</Note>

Proceed with the following steps only if you are sure you want to delete a cluster:

1. Turn off [deletion protection](#enable-deletion-protection) if it is enabled.
2. Click on the three-dots menu.
3. Select **Delete cluster**.
4. In the confirmation window, enter the name of the cluster.
5. Click **Delete**.
