Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache kafka 无法从主题中使用_Apache Kafka_Kafka Consumer Api_Kafka Producer Api - Fatal编程技术网

Apache kafka 无法从主题中使用

Apache kafka 无法从主题中使用,apache-kafka,kafka-consumer-api,kafka-producer-api,Apache Kafka,Kafka Consumer Api,Kafka Producer Api,当我尝试使用kafka控制台工具(V0.9.0.1,我认为这使用的是旧的使用者API)从托管在ec2中的kafka服务器使用消息时 我得到以下例外。 我怎样才能克服这个问题 kafka-console-consumer.sh --zookeeper zookeeper.xx.com:2181 --topic my-replicated-topic [2016-04-06 15:52:40,247] WARN [console-consumer-12572_Rathas-MacBook-Pro.l

当我尝试使用kafka控制台工具(V0.9.0.1,我认为这使用的是旧的使用者API)从托管在ec2中的kafka服务器使用消息时 我得到以下例外。 我怎样才能克服这个问题

kafka-console-consumer.sh --zookeeper zookeeper.xx.com:2181 --topic my-replicated-topic
[2016-04-06 15:52:40,247] WARN [console-consumer-12572_Rathas-MacBook-Pro.local-1459921957380-6ebc238f-leader-finder-thread], Failed to add leader for partitions [my-replicated-topic,1],[my-replicated-topic,2],[my-replicated-topic,0]; will retry (kafka.consumer.ConsumerFetcherManager$LeaderFinderThread)
java.nio.channels.ClosedChannelException
    at kafka.network.BlockingChannel.send(BlockingChannel.scala:110)
    at kafka.consumer.SimpleConsumer.liftedTree1$1(SimpleConsumer.scala:98)
    at kafka.consumer.SimpleConsumer.kafka$consumer$SimpleConsumer$$sendRequest(SimpleConsumer.scala:83)
    at kafka.consumer.SimpleConsumer.getOffsetsBefore(SimpleConsumer.scala:149)
    at kafka.consumer.SimpleConsumer.earliestOrLatestOffset(SimpleConsumer.scala:188)
    at kafka.consumer.ConsumerFetcherThread.handleOffsetOutOfRange(ConsumerFetcherThread.scala:84)
    at kafka.server.AbstractFetcherThread$$anonfun$addPartitions$2.apply(AbstractFetcherThread.scala:187)
    at kafka.server.AbstractFetcherThread$$anonfun$addPartitions$2.apply(AbstractFetcherThread.scala:182)
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:778)
    at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:777)
    at kafka.server.AbstractFetcherThread.addPartitions(AbstractFetcherThread.scala:182)
    at kafka.server.AbstractFetcherManager$$anonfun$addFetcherForPartitions$2.apply(AbstractFetcherManager.scala:88)
    at kafka.server.AbstractFetcherManager$$anonfun$addFetcherForPartitions$2.apply(AbstractFetcherManager.scala:78)
    at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:778)
    at scala.collection.immutable.Map$Map3.foreach(Map.scala:161)
    at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:777)
    at kafka.server.AbstractFetcherManager.addFetcherForPartitions(AbstractFetcherManager.scala:78)
    at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:95)
    at
我创建了一个主题,比如

/kafka-topics.sh --create --zookeeper zookeeper.xx.com:2181 --replication-factor 3 --partitions 3 --topic my-replicated-topic

你能为我复制的主题发布descripe命令的结果吗?@avr抱歉,我已经解决了这个问题。我有一些DNS问题,我在我的主机文件中修复了这些问题。现在我再也看不到这个问题了。我的原始版本与新卡夫卡消费者的版本相同。请检查kafka用户列表中的以下线程//连接本地服务器和远程服务器是否有任何行为变化?//和//消费者线程一直在等待,没有返回任何对象//@avr,我尝试了descripe命令,以解决无限轮询()问题,我得到的Leader为-1。这有什么线索吗?$/kafka-topics.sh--description--zookeer zookeer.xx.com:2181--topic MY_topic PartitionCount:MY_topic Partition:1 ReplicationFactor:1配置:topic:MY_topic Partition:0 Leader:-1 replications:1012 Isr:您使用的主题--是MY_topic还是MY replicated topic?你的问题和你的评论中的主题名称不匹配。我创建了几个主题用于测试。所有主题都给出相同的结果。你能为我复制的主题发布descripe命令的结果吗?@avr抱歉,我已经解决了这个问题。我有一些DNS问题,我在我的主机文件中修复了这些问题。现在我再也看不到这个问题了。我的原始版本与新卡夫卡消费者的版本相同。请检查kafka用户列表中的以下线程//连接本地服务器和远程服务器是否有任何行为变化?//和//消费者线程一直在等待,没有返回任何对象//@avr,我尝试了descripe命令,以解决无限轮询()问题,我得到的Leader为-1。这有什么线索吗?$/kafka-topics.sh--description--zookeer zookeer.xx.com:2181--topic MY_topic PartitionCount:MY_topic Partition:1 ReplicationFactor:1配置:topic:MY_topic Partition:0 Leader:-1 replications:1012 Isr:您使用的主题--是MY_topic还是MY replicated topic?问题和评论中的主题名称不匹配。我创建了几个主题用于测试。所有主题都给出相同的结果。