Scaling down Kafka Connect

Learn how you can downscale Kafka Connect in a Streams Messaging cluster.

Kafka Connect in a Streams Messaging cluster can be downscaled. The downscale operation differs depending on which Streams Messaging cluster template you are using. In the Light Duty template, Kafka Connect is downscaled by decommissioning nodes from the Broker host group. In the Heavy Duty template, Kafka Connect is downscaled by decommissioning nodes from the Connect host group.

There are two methods that can be used to downscale a cluster. You can either have Data Hub choose which nodes to decommission or manually specify which nodes should be decommissioned. The following steps walk you through both methods.

  • Ensure that you have reviewed Scaling Kafka Connect.
  • Ensure that the cluster, its hosts, and all its services are healthy.
  • Ensure that the Kafka brokers are commissioned and running.
  • Do not restart Kafka or Cruise Control during a downscale operation.
  • Do not create new partitions during a downscale operation.
  • If using the Light Duty cluster template ensure the following:
    • Ensure that the Cruise Control Service is running.
    • Using the Cruise Control REST API, verify that Cruise Control is reporting that all partitions are healthy.
      This can be done by calling the state API endpoint and ensuring the following in the response:
      • numValidPartitions is equal to numTotalPartitions
      • monitoringCoveragePct is 100.0
      API call example:
      https://[***MY-DATA-HUB-CLUSTER.COM***]/cdp-proxy-api/cruise-control/kafkacruisecontrol/state?json=true
      You can find the API base URL on the Endpoints tab of the Cluster Details page. Management Console > Data Hub Clusters > [***YOUR CLUSTER***] > Endpoints.

    This is required because in the Light Duty template, Kafka Connect is deployed on the same node as Kafka brokers. While Kafka Connect does not require Cruise Control for scaling, Kafka brokers do.

  1. Log in to the CDP web interface.
  2. Go to Management Console > Data Hub Clusters.
  3. Find and select the Data Hub cluster you want to scale.
  4. Decommission nodes.

    You can either let Data Hub choose which nodes to decommission or you can select the nodes that you want to have decommissioned.

    1. Click Actions > Resize.
    2. Select the host group you want to scale.

      For Light Duty clusters, select the Broker host group. For Heavy Duty clusters, select the Connect host group.

    3. Set the desired size of the host group.

      You can enter a number or use the plus and minus buttons to adjust the number of nodes.

    4. Click Resize.
    1. Go to Hardware.
    2. Scroll down to the appropriate host group.

      For Light Duty clusters, go to the Broker host group. For Heavy Duty clusters, go to the Connect host group.

    3. Select the nodes you want to remove.
    4. Click the Delete (trash bin) icon.
    5. Click Yes to confirm deletion.
  5. Access the Cloudera Manager instance managing the cluster.
  6. Restart all services that have stale configurations.
The cluster is downscaled. In Light Duty clusters, the number of nodes available in the Broker host group is equal to the configured number of nodes. In Heavy Duty clusters, the number of nodes available in the Connect host group is equal to the configured number of nodes. Connectors and tasks assigned to the decommissioned nodes are redistributed among remaining connect workers