kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jilin Xie <jilinxie1...@gmail.com>
Subject Re: Specify leader when doing partition reassignment
Date Wed, 05 Aug 2015 10:32:12 GMT
Check the --replica-assignment  parameter of the kafka-topics.sh.
It does what you need.
And there should also be similar configs in the api if you wanna do so by
coding.

On Wed, Aug 5, 2015 at 6:18 PM, tao xiao <xiaotao183@gmail.com> wrote:

> Hi team,
>
> Is it possible to specify a leader broker for each topic partition when
> doing partition reassignment?
>
> For example I have following json. Is the first broker in the replicas list
> by default the leader of the partition e.g. broker 3 is the leader of topic
> test5 and broker 2 is the leader of topic test3. or does Kafka
> automatically pick the leader based on the leadership ratio
> if auto.leader.rebalance.enable is on
>
> {
>   "version": 1,
>   "partitions": [
>     {
>       "topic": "test5",
>       "partition": 0,
>       "replicas": [3, 1]
>     },
>     {
>       "topic": "test3",
>       "partition": 0,
>       "replicas": [2,3]
>     },
>     {
>       "topic": "test1",
>       "partition": 0,
>       "replicas": [1,2]
>     }
>   ]
> }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message