Expanding Your Cluster

As usage of your Cassandra cluster increases you will need to add capacity. This article explains how to expand the capacity of your cluster by adding instances. We also offer dynamic vertical scaling; refer to our support article on In-place Data Centre Resizing for more information, or Horizontal Vs Vertical Scaling about which scaling method is best for your use case.  

Adding new nodes to a cluster can be completed without any interruption to the Cassandra service, or connected clients. However, the process of adding nodes causes re-streaming of stored data, which temporarily puts additional load on the cluster. Therefore where possible we recommend scheduling for a low usage period. Nodes are added one at a time, and adding a single node can take hours. The overhead of syncing a new node is particularly apparent in a small cluster (as the new nodes are a more significant portion of the overall cluster capacity). 

The NetApp Instaclustr managed platform can add new nodes to your cluster on request. Once triggered we run health checks on your cluster, add the new nodes one at a time, back each node up, and then free up space on the existing nodes. Where the request is supported via our Automated mechanisms, you can check progress through the Instaclustr Console or Cluster Management API, and stop the operation while it is running. Requests not eligible for the Automated mechanisms are still handled by Instaclustr Support. See Requests Handled by Instaclustr Support below. 

The processing and storage capacity of a Cassandra cluster with a well designed data model scales linearly as new nodes are added. NetApp Instaclustr requires you to keep the number of nodes balanced across Cassandra rack configurations when adding nodes – so if you have three racks in your cluster, you will add nodes in multiples of three in a single operation.

It is important to add capacity well before existing capacity (particularly disk space) is exhausted. If you are experiencing performance issues, adding additional nodes to an overutilized cluster may exacerbate the issues in the short term. We also do not recommend running any node at >70% disk utilisation in normal operations.

Table of Contents

Automated Horizontal Scaling (Adding Nodes)

Prerequisites

Your request is only accepted if all the following conditions are met: 

  • All nodes in the cluster are running. 
  • The cluster is not running under a free trial. 
  • No other operation is in progress on the cluster. This includes another horizontal scaling operation and operations such as adding a data centre. 
  • The new total number of nodes in the data centre is a multiple of the replication factor, which is the number of racks. 
  • You have permission to add nodes. 

Limitations

  • Only one data centre in a cluster can be scaled at a time. 
  • You can add up to 12 nodes in one automated scaling operation. Requests to add more nodes in a single scaling operation can be submitted via the same mechanism, but will be handled by Instaclustr Support. 
  • Removing nodes is not currently supported for Apache Cassandra data centres via the automated mechanism, but can be actioned by Instaclustr Support. 

Using Instaclustr Console

  1. To add nodes to your existing cluster, log into the Instaclustr Console. 
  2. Select your running Cassandra cluster from the sidebar menu and click Scaling.
  3. Select the data centre to which you would like to add nodes.
  4. Choose Horizontal Scaling and Confirm the details of the current nodes before clicking next.
  5. Input the new number of nodes you would like for the data centre on the Horizontal Scaling page and click the Resize button.Note: If your request is eligible for automated horizontal scaling, the node addition request is actioned immediately. If it is not, the page shows a notice that Instaclustr Support will verify the health of your cluster before provisioning the nodes. See Requests Handled by Instaclustr Support for details.
  6. After you click Resize, the Console shows the progress of the operation. The page shows the data centre, the current status, and a description of what is happening now. Progress is shown in three sections: Adding nodes, First backups and Cleanup. You will see each new node appear and move through PROVISIONING and JOINING to RUNNING.
  7. The Adding nodes section shows how many of the new nodes have been added. The table lists every node in the data centre, including the existing nodes. The First backups section shows how many new nodes have completed their first backup. Once a node has joined, we back it up as soon as its pending compactions have settled, which can take a while after its data has streamed in. 
  8. Cleanup removes data that moved to the new nodes from the pre-existing nodes. It starts only after every new node’s first backup has finished and the health checks have passed. The cleanup runs on one rack at a time. The scaling operation ends when cleanup finishes.

Stopping an Automated Horizontal Scaling Operation

In circumstances where you are experiencing impacts, you can click Stop on the Scaling progress page to stop a running scaling operation. The Console asks you to confirm and describes the impacts of proceeding with the stop. The status then changes to a “Stopping” type of message (e.g., “Stopping after the current node”), and into a “Stopped” type once the operation has ended. What happens depends on where the operation is: 

  • Initial health checks still running: The operation stops once the checks finish, without adding any nodes. Your cluster stays as it is. 
  • Nodes being added: The node currently being added finishes joining the cluster, including waiting for the previous node’s first backup, because that backup must finish before the new node can join. Added nodes stay in your cluster. The node being added when you stop does not receive a first backup. No further nodes are added, and cleanup does not run. This does not return your cluster to its original size.
  • All nodes added, waiting for backups and checks: All added nodes stay in your cluster. The operation stops waiting for first backups that have not finished, the remaining checks are skipped and cleanup does not run.
  • Cleanup running: Cleanup of the rack currently being cleaned finishes. The remaining racks are not cleaned. All nodes already added stay in your cluster.

If cleanup does not run, your pre-existing nodes keep data that moved to the new nodes. Contact Instaclustr Support if you want cleanup to be run. 

Automated Horizontal Scaling Operation Failures

If an operation fails, the Console Scaling page shows a notice with the reason for failure. Please contact Instaclustr Support for help. 

  • If it fails during the initial health checks, no nodes were added yet and hence your cluster is unchanged.  
  • If it fails after nodes were added, those nodes stay in your cluster and Instaclustr Support has been alerted and will investigate. For example, an operation fails if a node fails to be provisioned.  
  • If cleanup fails on a node, cleanup continues on the other nodes and Instaclustr Support follows up on the failed node. 

Using Instaclustr Cluster Management API

You can also add nodes with the Instaclustr Cluster Management API. Update your cluster and increase numberOfNodes on the data centre to the new total number of nodes. Eligible requests start the automated scaling operation and other requests are handled by Instaclustr Support. 

  • PUT /cluster-management/v2/resources/applications/cassandra/clusters/v2/{clusterId} increases numberOfNodes on the data centre. The new total must be a multiple of the replication factor which is the number of racks in the data centre. See the PUT API documentation.
  • GET /cluster-management/v2/data-sources/cluster-data-centres/v2/{clusterDataCentreId}/horizontal-scaling/operations lists operations and their progress. Use activeOnly=true for running operations only. See the GET API documentation.
  • DELETE /cluster-management/v2/operations/horizontal-scaling/v2/{operationId} stops a running scaling operation, with the same behaviour as Stop in the Console. Use the id returned by the GET request as the operationId. See the DELETE API documentation.

The diagram below demonstrates the operation statuses of the automated scaling workflow. 

Using Instaclustr Terraform Provider

You can also add nodes with the Instaclustr Terraform Provider. In your instaclustr_cassandra_cluster_v2 resource, increase number_of_nodes on the data_centre block to the new total number of nodes. For example, to grow a data centre from 3 to 6 nodes: 

Terraform sends the same update request as Instaclustr Cluster Management API, so the same rules apply. Run terraform plan first to check that only number_of_nodes changes. Eligible requests start the automated operation and other requests are handled by Instaclustr Support. You can track progress in Instaclustr Console or with Instaclustr Cluster Management API. To stop an operation, use Stop in Instaclustr Console or Instaclustr Cluster Management API, as Terraform cannot stop it. 

Requests Handled by Instaclustr Support

In the cases outside of our automated system, Instaclustr Support will verify the health of your cluster before provisioning additional nodes. We aim to start this process within one business day and will contact you to confirm when the additional nodes have been provisioned.  

In these cases the Console shows the new nodes as DEFERRED until Instaclustr Support provisions them. This applies when: 

  • more than 12 nodes are requested to be added in one operation 
  • the request changes the number of nodes in more than one data centre 
  • the data centre uses the Apache Spark or Debezium Connector for Apache Cassandra add-on 
  • the data centre uses developer node sizes 
  • the Cassandra nodes in the data centre are not all the same size 
  • the cluster belongs to a Heroku account 
  • a rack does not have enough free IP address capacity for the new nodes 

Adding a Data Centre

  1. To add a new Data Centre to your existing cluster, log into the Instaclustr Console.
  2. Select your running Cassandra cluster from the sidebar menu and click Add Data Centre.

  3. Under the Settings section of the wizard, specify an infrastructure provider for your new data centre. Then choose your desired Cassandra settings and any additional add-ons that you require for the new data centre.‎
  4. Under the Data Centre section, specify a Region, Name and Network Range for your new Data Centre. Then select the number of nodes for your Cassandra application and your desired Node Size.
    ‎
    If the data centre for your cluster is running on Amazon’s EBS infrastructure, you can also choose to encrypt your data with an AWS KMS key. Note: Multi-region or multi-provider clusters will incur additional network charges. Please contact [email protected] to confirm.
  5. Finally, the Confirmation section displays a brief summary of your data centre configurations and pricing details. Once you have verified the details, click the Add Data Centre button.
    Note: To ensure consistent stability and performance, Instaclustr Support will verify the health of your cluster before provisioning an additional data centre. We aim to start this process within one business day and will contact you once the additional data centre has been provisioned.