Reassign Partition
Last updated
Last updated
make sure to stop all kafka & zookeeper server
by ctrl+c in your terminal or
call kafka-server-stop.sh for kafka broker and call zookeeper-server-stop.sh for zookeeper
make sure with jps command
clear zookeeper & kafka data
start the Zookeeper and Kafka cluster from the . This cluster will be used for this lab. run cli in each terminal (1 shell script 1 terminal)
First, create a new topic which will be later used for reassigning:
view topic detial, keep information about topic
example result, keep information about leader such as leader:0
load data to topic
Next, we generate reassignment file.
generate reassign file, change broker-list to another value except value from leader info from previous describe topic command (such as previous command leader:0, set broker-list to 1,2 from 0,1,2 or if leader:1, set broker-list to 0,2 etc.)
example result
Next we can use the prepared file to trigger the reassignment.
example result
check reassign partition status
example result
check partition information again
example result, make sure leader change, replicas change
Check the file which tells the tool for which topics should the file be generated.
example of
copy this proposed partition reassignment and paste it in a local file