-
Notifications
You must be signed in to change notification settings - Fork 145
module remove
The remove module simplifies the task of removing a single broker from the cluster. This is helpful in the case of needing to shrink a cluster, or migrating partition off of a broker before performing hardware maintenance. The replication factor of the partitions is maintained by replacing the broker being removed with another broker in the cluster.
The following are the options for this module:
Option | Required | Argument | Default | Description |
---|---|---|---|---|
--broker | yes | integers | The broker ID to be removed from the cluster | |
--to_brokers | no | list of integers | all cluster brokers | A list (space separated) of broker IDs to be used to replace the broker being removed. If not specified, all brokers in the cluster (except the one being removed) are used |
All examples assume the cluster Zookeeper connect string is zook.example.com:2181/kafka/clustername
Example 1: Remove the broker with ID 1234 from the cluster, replacing with all other brokers in the cluster
kafka-assigner.py -z zook.example.com:2181/kafka/clustername -e remove -b 1234
Example 2: Remove the broker with ID 1234 from the cluster, replacing with only brokers 56, 78, and 90
kafka-assigner.py -z zook.example.com:2181/kafka/clustername -e remove --broker 1234 --to_brokers 56 78 90
Replacement brokers are selected in a round-robin fashion from the list of to_brokers. No attempt is made at balancing.