// Module included in the following assemblies:
//
// configuring/assembly-reassign-tool.adoc

[id='proc-scaling-up-a-kafka-cluster-{context}']

= Reassigning partitions after adding brokers

[role="_abstract"]
Use a reassignment file generated by the `kafka-reassign-partitions.sh` tool to reassign partitions after increasing the number of brokers in a Kafka cluster.
The reassignment file should describe how partitions are reassigned to brokers in the enlarged Kafka cluster.
You apply the reassignment specified in the file to the brokers and then verify the new partition assignments.

This procedure describes a secure scaling process that uses TLS.
You'll need a Kafka cluster that uses TLS encryption and mTLS authentication.

The `kafka-reassign-partitions.sh` tool can be used to reassign partitions within a Kafka cluster, regardless of whether you are managing all nodes through the cluster or using the node pools to manage groups of nodes within the cluster.

NOTE: Though you can use the `kafka-reassign-partitions.sh` tool, Cruise Control is recommended xref:cruise-control-concepts-str[for automated partition reassignments and cluster rebalancing]. 
Cruise Control can move topics from one broker to another without any downtime, and it is the most efficient way to reassign partitions.

.Prerequisites

* You have a running Kafka cluster based on a `Kafka` resource configured with internal TLS encryption and mTLS authentication.
* You have xref:proc-generating-reassignment-json-files-{context}[generated a reassignment JSON file] named `reassignment.json`.
* You are running an interactive pod container that is connected to the running Kafka broker.
* You are connected as a `KafkaUser` configured with ACL rules that specify permission to manage the Kafka cluster and its topics.

.Procedure

. Add as many new brokers as you need by increasing the `Kafka.spec.kafka.replicas` configuration option.

. Verify that the new broker pods have started.

include::snip-reassign-partitions.adoc[]
