You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Hang HOU (Jira)" <ji...@apache.org> on 2022/09/28 09:20:00 UTC

[jira] [Comment Edited] (KAFKA-3332) Consumer can't consume messages from zookeeper chroot

    [ https://issues.apache.org/jira/browse/KAFKA-3332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610459#comment-17610459 ] 

Hang HOU edited comment on KAFKA-3332 at 9/28/22 9:19 AM:
----------------------------------------------------------

About my last description,I found it was my mistake. I used wrong topic name,just like topic A in host-10-19-29-165:2181/left znode,and topic B in host-10-19-29-165:2181/right.And i devided kafka cluster into 2 different clusters(combine with that different znode),then A in sub-cluster1,B in sub-cluster2.So i should have used correct topic to consume and produce ,and the broker-id must contain the topic ,because it was no longer the "only one cluster"


was (Author: JIRAUSER289640):
About my last description,I found it was my mistake. I used wrong topic name,just like topic A in host-10-19-29-165:2181/left znode,anbe topic B in host-10-19-29-165:2181/right.and i devided kafka cluster into 2 different clusters,then A in sub-cluster1,B in sub-cluster2.So i should have used correct topic to consume and produce ,and the broker-id must contain the topic ,because it was no longer the "only one cluster"

> Consumer can't consume messages from zookeeper chroot
> -----------------------------------------------------
>
>                 Key: KAFKA-3332
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3332
>             Project: Kafka
>          Issue Type: Bug
>          Components: consumer
>    Affects Versions: 0.8.2.2, 0.9.0.1
>         Environment: RHEL 6.X, OS X
>            Reporter: Sergey Vergun
>            Assignee: Neha Narkhede
>            Priority: Major
>
> I have faced issue when consumer can't consume messages from zookeeper chroot. It was tested on Kafka 0.8.2.2 and Kafka 0.9.0.1
> My zookeeper options into server.properties:
> $cat config/server.properties | grep zookeeper
> zookeeper.connect=localhost:2181/kafka-cluster/kafka-0.9.0.1
> zookeeper.session.timeout.ms=10000
> zookeeper.connection.timeout.ms=10000
> zookeeper.sync.time.ms=2000
> I can create successfully a new topic
> $kafka-topics.sh --create --partition 3 --replication-factor 1 --topic __TEST-Topic_1 --zookeeper localhost:2181/kafka-cluster/kafka-0.9.0.1
> Created topic "__TEST-Topic_1".
> and produce messages into it
> $kafka-console-producer.sh --topic __TEST-Topic_1 --broker-list localhost:9092
> 1
> 2
> 3
> 4
> 5
> In Kafka Manager I see that messages was delivered:
> Sum of partition offsets	5
> But I can't consume the messages via kafka-console-consumer
> $kafka-console-consumer.sh --topic TEST-Topic_1 --zookeeper localhost:2181/kafka-cluster/kafka-0.9.0.1 --from-beginning
> The consumer is present in zookeeper
> [zk: localhost:2181(CONNECTED) 10] ls /kafka-cluster/kafka-0.9.0.1/consumers
> [console-consumer-62895] 
> [zk: localhost:2181(CONNECTED) 12] ls /kafka-cluster/kafka-0.9.0.1/consumers/console-consumer-62895/ids
> [console-consumer-62895_SV-Macbook-1457097451996-64640cc1] 
> If I reconfigure kafka cluster with zookeeper chroot "/" then everything is ok.
> $cat config/server.properties | grep zookeeper
> zookeeper.connect=localhost:2181
> zookeeper.session.timeout.ms=10000
> zookeeper.connection.timeout.ms=10000
> zookeeper.sync.time.ms=2000
> $kafka-console-producer.sh --topic __TEST-Topic_1 --broker-list localhost:9092
> 1
> 2
> 3
> 4
> 5
> $kafka-console-consumer.sh --topic TEST-Topic_1 --zookeeper localhost:2181 --from-beginning
> 1
> 2
> 3
> 4
> 5
> Is it bug or my mistake?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)