Skip to content

Useful if you need to change the replication factor of an already created Kafka topic. It creates the JSON necessary for the kafka command kafka-reassign-partitions.

Notifications You must be signed in to change notification settings

dkurzaj/generate-kafka-replication-factor-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

generate-kafka-replication-factor-json

Useful if you need to change the replication factor of an already created Kafka topic. It creates the JSON necessary for the kafka command kafka-reassign-partitions.

Usage

In the generate-kafka-replication-factor-json.sh file, you just have to change the values of the following variables to match your needs:

  • BROKER_IDS
  • NUMBER_OF_PARTITIONS
  • NUMBER_OF_REPLICAS
  • TOPIC_NAME

It will generate the result in a increase-replication-factor.json file.

Now you just have to use this JSON with the kafka-reassign-partitions Kafka command:

$ ./kafka-reassign-partitions.sh --zookeeper localhost:2181 --reassignment-json-file increase-replication-factor.json --execute

You can check your new replication policy worked with:

$ ./kafka-topics.sh --zookeeper localhost:2181 --topic topic --describe

About

Useful if you need to change the replication factor of an already created Kafka topic. It creates the JSON necessary for the kafka command kafka-reassign-partitions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages