Support Questions
Find answers, ask questions, and share your expertise

Kafka: Can the number of partitions (per topic) be changed after creation?

Highlighted

Kafka: Can the number of partitions (per topic) be changed after creation?

The Kafka documentation states we can’t reduce the number of partitions per topic once created. Can we then increase them or is it a documentation mistake? If we are allowed to add new partitions and use keys to get our messages wouldn’t the old messages be unreachable?

3 REPLIES 3
Highlighted

Re: Kafka: Can the number of partitions (per topic) be changed after creation?

Explorer

Yes , you can increase the number of partitions using the topic script. Please see https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools#Replicationtools-5.AddPartitionT...

Highlighted

Re: Kafka: Can the number of partitions (per topic) be changed after creation?

Contributor

@pbrahmbhatt

How can we set default partition size for dynamically created topics?

Highlighted

Re: Kafka: Can the number of partitions (per topic) be changed after creation?

New Contributor

set num.partition=x in the server.properties