You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Jilin Xie <ji...@gmail.com> on 2015/07/27 09:25:11 UTC

Choosing brokers when creating topics

Hi
      Is it possible to choose which brokers to use when creating a topic?
The general command of creating topic is:

*bin/kafka-topics.sh --create --zookeeper localhost:2181
--replication-factor 1 --partitions 1 --topic test*

What I'm looking for is:

*bin/kafka-topics.sh --create .....  "--broker-to-use xxx;xxx;xxx"*


*It's because, I want the topic to be hosted on the brokers which
would be closest to the possible producer.*


*       Thanks in advance.*

Re: Choosing brokers when creating topics

Posted by Jilin Xie <ji...@gmail.com>.
Hi Even
       Thanks for your reply.
        I've been using  the kafka-reassign-partition tool.
       But --replica-assignment is exactly what I'm looking for.

       Thanks

On Mon, Jul 27, 2015 at 3:58 PM, Ewen Cheslack-Postava <ew...@confluent.io>
wrote:

> Try the --replica-assignment option for kafka-topics.sh. It allows you to
> specify which brokers to assign as replicas instead of relying on the
> assignments being made automatically.
>
> -Ewen
>
> On Mon, Jul 27, 2015 at 12:25 AM, Jilin Xie <ji...@gmail.com>
> wrote:
>
> > Hi
> >       Is it possible to choose which brokers to use when creating a
> topic?
> > The general command of creating topic is:
> >
> > *bin/kafka-topics.sh --create --zookeeper localhost:2181
> > --replication-factor 1 --partitions 1 --topic test*
> >
> > What I'm looking for is:
> >
> > *bin/kafka-topics.sh --create .....  "--broker-to-use xxx;xxx;xxx"*
> >
> >
> > *It's because, I want the topic to be hosted on the brokers which
> > would be closest to the possible producer.*
> >
> >
> > *       Thanks in advance.*
> >
>
>
>
> --
> Thanks,
> Ewen
>

Re: Choosing brokers when creating topics

Posted by Ewen Cheslack-Postava <ew...@confluent.io>.
Try the --replica-assignment option for kafka-topics.sh. It allows you to
specify which brokers to assign as replicas instead of relying on the
assignments being made automatically.

-Ewen

On Mon, Jul 27, 2015 at 12:25 AM, Jilin Xie <ji...@gmail.com> wrote:

> Hi
>       Is it possible to choose which brokers to use when creating a topic?
> The general command of creating topic is:
>
> *bin/kafka-topics.sh --create --zookeeper localhost:2181
> --replication-factor 1 --partitions 1 --topic test*
>
> What I'm looking for is:
>
> *bin/kafka-topics.sh --create .....  "--broker-to-use xxx;xxx;xxx"*
>
>
> *It's because, I want the topic to be hosted on the brokers which
> would be closest to the possible producer.*
>
>
> *       Thanks in advance.*
>



-- 
Thanks,
Ewen