Yes you can increase on the fly using the kafka-topics script. As Sharninder mentioned this could break applications that have partitioning logic.
./kafka-topics ‹alter ‹partitions <new # of partitions> -Clark chask...@linkedin.com https://www.linkedin.com/in/clarkhaskins There is no place like 127.0.0.1 On 7/26/14, 1:06 AM, "Sharninder" <sharnin...@gmail.com> wrote: >You can add partitions at runtime but not delete (AFAIK, someone correct >me >if I'm wrong). The reason it's usually discouraged is that when partitions >get added to a topic, the message assignment changes and if you're >application depends on some partitioning logic, that will fail. > >-- >Sharninder > > > >On Sat, Jul 26, 2014 at 2:29 AM, Kashyap Mhaisekar <kashya...@gmail.com> >wrote: > >> Great. Thanks all. But there is no easy way to change partitions once >>the >> topic is created right? I run kafka 0.8.2 and its a difficult job to >> reassign partitions. >> >> >> On Fri, Jul 25, 2014 at 3:10 PM, Clark Haskins < >> chask...@linkedin.com.invalid> wrote: >> >> > You can have more partitions than machines in the cluster, you cannot >> > however have a replication factor that is great than the number of >> > machines in the cluster. >> > >> > You could easily have a topic with 100 partitions on a 3 node cluster. >> > >> > -Clark >> > >> > >> > Clark Elliott Haskins III >> > LinkedIn DDS Site Reliability Engineer >> > Kafka, Zookeeper, Samza SRE >> > Mobile: 505.385.1484 >> > BlueJeans: https://www.bluejeans.com/chaskins >> > >> > >> > chask...@linkedin.com >> > https://www.linkedin.com/in/clarkhaskins >> > There is no place like 127.0.0.1 >> > >> > >> > >> > >> > On 7/23/14, 2:14 PM, "Kashyap Mhaisekar" <kashya...@gmail.com> wrote: >> > >> > >HI, >> > >Is the maximum no. of partitions for a topic dependent on the no. of >> > >machines in a kafka cluster? >> > >For e.g., if I have 3 machines in a cluster, can I have 5 partitions >> with >> > >a >> > >caveat that one machine can host multiple partitions for a given >>topic? >> > > >> > >Regards, >> > >Kashyap >> > >> > >>