Resize a Cluster
Serverless clusters are elastic and automatically scale based on workloads. There is no need to manually size or resize a Serverless cluster.
This topic describes how to resize an existing StreamNative cluster, including Dedicated, BYOC, and BYOC Pro clusters. These clusters are provisioned and billed in terms of CUs and SUs. Evaluating the number of CUs and SUs your cluster requires helps you reduce costs or scale to meet your data streaming needs.
When you resize a StreamNative cluster, StreamNative automatically redistributes the traffic to help ensure a balanced load across the remaining brokers in the cluster. If you’re reducing the size of the cluster, StreamNative removes unused brokers at the end of load balancing and removes unused bookies after re-replication.
Once you request a resize for your cluster, you cannot request another update until the initially requested resize has completed.
Resize a Cluster
This section shows you how to resize an existing StreamNative Cloud cluster, including scaling up and down the cluster and adjusting the required resources.
Prerequisites:
- An existing StreamNative Cluster
You can expand the number of CUs and SUs in the StreamNative Cloud Console.
-
Log in to the StreamNative Cloud Console.
-
Navigate to the Cluster Workspace.
-
Click Configuration in the left navigation pane to access Cluster Configuration.
-
On the Cluster Configuration page, click the Edit Cluster button in the top-right corner. You will be redirected to the Cluster Provisioning page where you can update the cluster configuration and adjust the sizing of the cluster.
-
Skip the Cluster Configuration page by clicking the Cluster Size button. You will be redirected to the Cluster Size page.
-
On the Cluster Size page, you can choose between Basic or Advanced mode to expand the cluster.
-
Basic Mode: Use the slider to adjust the required throughput. StreamNative Cloud will automatically calculate the number of brokers and bookies, as well as their respective CUs and SUs per node.
-
Advanced Mode: Manually adjust the number of brokers, bookies, CUs, and SUs per node.
-
-
Click the Finish button to complete the cluster expansion.
The cluster will start scaling up, and you will be redirected to a Deploying page that shows the progress of the deployment process. The deployment might take a few minutes to complete, depending on how many resources you are scaling up. You can always click Go To The Dashboard to return to the Cluster Dashboard page. You can see the number of brokers and bookies in real-time on the Cluster Dashboard page.
You can expand the number of CUs and SUs in the StreamNative Cloud Console.
-
Log in to the StreamNative Cloud Console.
-
Navigate to the Cluster Workspace.
-
Click Configuration in the left navigation pane to access Cluster Configuration.
-
On the Cluster Configuration page, click the Edit Cluster button in the top-right corner. You will be redirected to the Cluster Provisioning page where you can update the cluster configuration and adjust the sizing of the cluster.
-
Skip the Cluster Configuration page by clicking the Cluster Size button. You will be redirected to the Cluster Size page.
-
On the Cluster Size page, you can choose between Basic or Advanced mode to expand the cluster.
-
Basic Mode: Use the slider to adjust the required throughput. StreamNative Cloud will automatically calculate the number of brokers and bookies, as well as their respective CUs and SUs per node.
-
Advanced Mode: Manually adjust the number of brokers, bookies, CUs, and SUs per node.
-
-
Click the Finish button to complete the cluster expansion.
The cluster will start scaling up, and you will be redirected to a Deploying page that shows the progress of the deployment process. The deployment might take a few minutes to complete, depending on how many resources you are scaling up. You can always click Go To The Dashboard to return to the Cluster Dashboard page. You can see the number of brokers and bookies in real-time on the Cluster Dashboard page.
CUs and SUs are reflected as the number of CPU and Memory used by the brokers and bookies. When expanding a cluster via snctl
, you can modify the number of bookies and brokers, as well as their corresponding CPU, Memory, and Disk resources. This is done by updating the PulsarCluster Custom Resource Definition (CRD).
To expand your cluster using snctl
, follow these steps:
-
Retrieve the current cluster configuration:
-
Edit the
cluster-config.yaml
file to increase the resources. For example:-
Increase the number of brokers or bookies:
-
Adjust the CPU, memory, or storage for brokers or bookies:
These examples demonstrate how to modify the PulsarCluster CRD to scale your cluster’s resources.
-
-
Apply the updated configuration:
After snctl apply
is completed, the cluster will initiate the expansion process. The operation may take several minutes to complete, depending on the scale of the expansion.
You can check the status of your PulsarCluster to monitor the progress. The PulsarCluster resource includes a status block that provides valuable information about the current state of your cluster components.
To check the status, you can use the following command:
Here’s an example of what the status block might look like:
When all the readyReplicas
, replicas
, and updatedReplicas
are the same, the cluster expansion is complete.
CUs (Compute Units) and SUs (Storage Units) are reflected in the CPU and memory resources used by brokers and bookies, respectively. When expanding a cluster via the Terraform Provider, you can modify the number of bookies and brokers, as well as the CUs per broker and SUs per bookie. This is accomplished by updating the streamnative_pulsar_cluster resource.
To resize a cluster using the StreamNative Terraform Provider, follow these steps:
-
Update your Terraform configuration file (e.g.,
main.tf
) to modify the cluster resources. Here’s an example of how to update the cluster configuration: -
After updating the configuration, run the following Terraform commands:
This command will show you the planned changes to your StreamNative cluster.
-
If the plan looks correct, apply the changes:
Terraform will then initiate the cluster expansion process. The operation may take several minutes to complete, depending on the scale of the expansion.
-
You can monitor the progress of the cluster scaling operation by checking the Terraform output or by using the Cluster Dashboard on StreamNative Cloud console.
-
To verify the status of your cluster after the operation, you can use the
terraform show
command or check the Cluster Dashboard on StreamNative Cloud console for the most up-to-date information on your cluster’s resources and status.
Remember to always review the changes carefully before applying them to your production environment. It’s recommended to test any scaling operations in a non-production environment first.