1. Tools
  2. Pulsar Operator

Manual scaling

This tutorial guides you through resizing the Pulsar cluster based on your workload demand. When workload increases, you can add nodes to scale up the cluster. When workload decreases, you can scale the Pulsar cluster back down.

You can resize a Pulsar cluster by increasing or decreasing the number of replicas for Pulsar components, including the Pulsar brokers, BookKeeper, ZooKeeper, and Pulsar Proxy.

Scale Pulsar brokers

To scale up or down the Pulsar brokers, follow these steps.

  1. Add the environment variables for the Pulsar Chart directory, Pulsar cluster name, and Kubernetes namespace.

    # If you use the offline version, export PULSAR_CHART first.
    export PULSAR_CHART=/path/to/pulsar/chart
    # Define your Pulsar cluster name
    export RELEASE_NAME=<release_name>
    # Define the K8s namespace to install the pulsar cluster
    export NAMESPACE=<k8s_namespace>
    
  2. Increase or decrease the number of nodes by setting the replicaCount option with a greater or smaller value in the Pulsar cluster manifest file.

    This example scales the number of Pulsar brokers from 5 to 9.

    broker:
      replicaCount: 9 # In this example, scaling up from 5
    
  3. Update the Pulsar cluster with the new settings.

    helm upgrade -f /path/to/pulsar/file.yaml $RELEASE_NAME $PULSAR_CHART
    

Scale Pulsar Proxy

To scale up or down the Pulsar Proxy, follow these steps.

  1. Add the environment variables for the Pulsar Chart directory, Pulsar cluster name, and Kubernetes namespace.

    # If you use the offline version, export PULSAR_CHART first.
    export PULSAR_CHART=/path/to/pulsar/chart
    # Define your Pulsar cluster name
    export RELEASE_NAME=<release_name>
    # Define the K8s namespace to install the pulsar cluster
    export NAMESPACE=<k8s_namespace>
    
  2. Increase or decrease the number of nodes by setting the replicaCount option with a greater or smaller value in the Pulsar cluster manifest file.

    This example scales the number of Pulsar Proxy from 1 to 3.

    proxy:
      replicaCount: 3 # In this example, scaling up from 1
    
  3. Update the Pulsar cluster with the new settings.

    helm upgrade -f /path/to/pulsar/file.yaml $RELEASE_NAME $PULSAR_CHART
    
Previous
Install Pulsar Operator