You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Jiang Jacky <ji...@gmail.com> on 2014/09/30 19:45:59 UTC
Created topic by 2 partitions, only can use the one partition
Hi, Guys
It is very weird, I created a topic with 2 partitions couple weeks ago, and
I can only production the message to partition 0, not partition 1, but for
now, I created a new topic again with 2 partitions, it does work.
So whats problem of the old topic? I tried to describe the old topic, I
found the following message
Topic: xxxx Partition: 0 Leader: 1 Replicas: 1
Isr: 1
Topic: xxxx Partition: 1 Leader: 2 Replicas: 2
Isr: 2
Please let me know, if the topic is screwed up.
Thank you
Re: Created topic by 2 partitions, only can use the one partition
Posted by Joe Stein <jo...@stealth.ly>.
Do you have any errors in the logs? Are you using a partition key or is
your KeyedMessage just topic and message? If your not using a partition key
then then take a look at this
https://cwiki.apache.org/confluence/display/KAFKA/FAQ#FAQ-Whyisdatanotevenlydistributedamongpartitionswhenapartitioningkeyisnotspecified
?
You can try using https://github.com/edenhill/kafkacat which is an
stdout/stdin producer/consumer command line tool for kafka. And then you
can do
echo "test"|kafakcat -b yourKafkaBroker -t xxxx -p 0
echo "test"|kafakcat -b yourKafkaBroker -t xxxx -p 1
and see if it works trying to explicitly write to both partitions, if that
works then see above and if it doesn't work then you should get an error.
/*******************************************
Joe Stein
Founder, Principal Consultant
Big Data Open Source Security LLC
http://www.stealth.ly
Twitter: @allthingshadoop <http://www.twitter.com/allthingshadoop>
********************************************/
On Wed, Oct 1, 2014 at 7:31 AM, Jacky <ji...@gmail.com> wrote:
> Anyone has idea? Thank you
>
> Sent from my iPhone
>
> > On Sep 30, 2014, at 1:45 PM, Jiang Jacky <ji...@gmail.com> wrote:
> >
> > Hi, Guys
> > It is very weird, I created a topic with 2 partitions couple weeks ago,
> and I can only production the message to partition 0, not partition 1, but
> for now, I created a new topic again with 2 partitions, it does work.
> > So whats problem of the old topic? I tried to describe the old topic, I
> found the following message
> >
> > Topic: xxxx Partition: 0 Leader: 1 Replicas: 1
> Isr: 1
> > Topic: xxxx Partition: 1 Leader: 2 Replicas: 2
> Isr: 2
> >
> > Please let me know, if the topic is screwed up.
> >
> > Thank you
> >
> >
>
Re: Created topic by 2 partitions, only can use the one partition
Posted by Nathan Leung <nc...@gmail.com>.
It appears the bug I was referencing is fixed in the version you're using:
https://issues.apache.org/jira/browse/KAFKA-1183
On Thu, Oct 2, 2014 at 2:00 PM, Jiang Jacky <ji...@gmail.com> wrote:
> Hi, So far, I just have 1 producer, and I am using kafka lib
> version 0.8.1.1
> Thank you guys!
>
> 2014-10-01 9:12 GMT-04:00 Nathan Leung <nc...@gmail.com>:
>
> how many producers do you have? there was a bug with older versions of
>> kafka (don't know if it's fixed in release version, I'd have to dig up the
>> issue) where if you don't have message id set when you produce the message,
>> it will only send to one partition at a time. if you have more than 1
>> producer at a time then each would write to a separate partition.
>>
>> On Wed, Oct 1, 2014 at 7:31 AM, Jacky <ji...@gmail.com> wrote:
>>
>>> Anyone has idea? Thank you
>>>
>>> Sent from my iPhone
>>>
>>> > On Sep 30, 2014, at 1:45 PM, Jiang Jacky <ji...@gmail.com> wrote:
>>> >
>>> > Hi, Guys
>>> > It is very weird, I created a topic with 2 partitions couple weeks
>>> ago, and I can only production the message to partition 0, not partition 1,
>>> but for now, I created a new topic again with 2 partitions, it does work.
>>> > So whats problem of the old topic? I tried to describe the old topic,
>>> I found the following message
>>> >
>>> > Topic: xxxx Partition: 0 Leader: 1 Replicas: 1
>>> Isr: 1
>>> > Topic: xxxx Partition: 1 Leader: 2 Replicas: 2
>>> Isr: 2
>>> >
>>> > Please let me know, if the topic is screwed up.
>>> >
>>> > Thank you
>>> >
>>> >
>>>
>>
>>
>
Re: Created topic by 2 partitions, only can use the one partition
Posted by Jiang Jacky <ji...@gmail.com>.
Hi, So far, I just have 1 producer, and I am using kafka lib version 0.8.1.1
Thank you guys!
2014-10-01 9:12 GMT-04:00 Nathan Leung <nc...@gmail.com>:
> how many producers do you have? there was a bug with older versions of
> kafka (don't know if it's fixed in release version, I'd have to dig up the
> issue) where if you don't have message id set when you produce the message,
> it will only send to one partition at a time. if you have more than 1
> producer at a time then each would write to a separate partition.
>
> On Wed, Oct 1, 2014 at 7:31 AM, Jacky <ji...@gmail.com> wrote:
>
>> Anyone has idea? Thank you
>>
>> Sent from my iPhone
>>
>> > On Sep 30, 2014, at 1:45 PM, Jiang Jacky <ji...@gmail.com> wrote:
>> >
>> > Hi, Guys
>> > It is very weird, I created a topic with 2 partitions couple weeks ago,
>> and I can only production the message to partition 0, not partition 1, but
>> for now, I created a new topic again with 2 partitions, it does work.
>> > So whats problem of the old topic? I tried to describe the old topic, I
>> found the following message
>> >
>> > Topic: xxxx Partition: 0 Leader: 1 Replicas: 1
>> Isr: 1
>> > Topic: xxxx Partition: 1 Leader: 2 Replicas: 2
>> Isr: 2
>> >
>> > Please let me know, if the topic is screwed up.
>> >
>> > Thank you
>> >
>> >
>>
>
>
Re: Created topic by 2 partitions, only can use the one partition
Posted by Nathan Leung <nc...@gmail.com>.
how many producers do you have? there was a bug with older versions of
kafka (don't know if it's fixed in release version, I'd have to dig up the
issue) where if you don't have message id set when you produce the message,
it will only send to one partition at a time. if you have more than 1
producer at a time then each would write to a separate partition.
On Wed, Oct 1, 2014 at 7:31 AM, Jacky <ji...@gmail.com> wrote:
> Anyone has idea? Thank you
>
> Sent from my iPhone
>
> > On Sep 30, 2014, at 1:45 PM, Jiang Jacky <ji...@gmail.com> wrote:
> >
> > Hi, Guys
> > It is very weird, I created a topic with 2 partitions couple weeks ago,
> and I can only production the message to partition 0, not partition 1, but
> for now, I created a new topic again with 2 partitions, it does work.
> > So whats problem of the old topic? I tried to describe the old topic, I
> found the following message
> >
> > Topic: xxxx Partition: 0 Leader: 1 Replicas: 1
> Isr: 1
> > Topic: xxxx Partition: 1 Leader: 2 Replicas: 2
> Isr: 2
> >
> > Please let me know, if the topic is screwed up.
> >
> > Thank you
> >
> >
>
Re: Created topic by 2 partitions, only can use the one partition
Posted by Jacky <ji...@gmail.com>.
Anyone has idea? Thank you
Sent from my iPhone
> On Sep 30, 2014, at 1:45 PM, Jiang Jacky <ji...@gmail.com> wrote:
>
> Hi, Guys
> It is very weird, I created a topic with 2 partitions couple weeks ago, and I can only production the message to partition 0, not partition 1, but for now, I created a new topic again with 2 partitions, it does work.
> So whats problem of the old topic? I tried to describe the old topic, I found the following message
>
> Topic: xxxx Partition: 0 Leader: 1 Replicas: 1 Isr: 1
> Topic: xxxx Partition: 1 Leader: 2 Replicas: 2 Isr: 2
>
> Please let me know, if the topic is screwed up.
>
> Thank you
>
>
Re: Created topic by 2 partitions, only can use the one partition
Posted by Guozhang Wang <wa...@gmail.com>.
Hi Jiang,
Which producer client did you use? And did you specify any keys for your
sent messages?
Guozhang
On Tue, Sep 30, 2014 at 10:45 AM, Jiang Jacky <ji...@gmail.com> wrote:
> Hi, Guys
> It is very weird, I created a topic with 2 partitions couple weeks ago, and
> I can only production the message to partition 0, not partition 1, but for
> now, I created a new topic again with 2 partitions, it does work.
> So whats problem of the old topic? I tried to describe the old topic, I
> found the following message
>
> Topic: xxxx Partition: 0 Leader: 1 Replicas: 1
> Isr: 1
> Topic: xxxx Partition: 1 Leader: 2 Replicas: 2
> Isr: 2
>
> Please let me know, if the topic is screwed up.
>
> Thank you
>
--
-- Guozhang
Re: Created topic by 2 partitions, only can use the one partition
Posted by Jacky <ji...@gmail.com>.
Anyone has idea? Thank you
Sent from my iPhone
> On Sep 30, 2014, at 1:45 PM, Jiang Jacky <ji...@gmail.com> wrote:
>
> Hi, Guys
> It is very weird, I created a topic with 2 partitions couple weeks ago, and I can only production the message to partition 0, not partition 1, but for now, I created a new topic again with 2 partitions, it does work.
> So whats problem of the old topic? I tried to describe the old topic, I found the following message
>
> Topic: xxxx Partition: 0 Leader: 1 Replicas: 1 Isr: 1
> Topic: xxxx Partition: 1 Leader: 2 Replicas: 2 Isr: 2
>
> Please let me know, if the topic is screwed up.
>
> Thank you
>
>