我有两个主机A和B.安装了zookeeper和kafka(0.9.0.1)。 B上安装了火花。 现在,当我尝试从A通过spark流式读取kafka主题并将数据保存到B. 这是问题,当我运行spark应用程序时,它会不断地彻底抛出以下错误,
17/04/20 05:22:16 ERROR ReceiverTracker: Deregistered receiver for stream 0: Error starting receiver 0 - kafka.common.ConsumerRebalanceFailedException: OlapEventsJamba_appEvent_HOSTA-1492680125896-b52bf576 can't rebalance after 4 retries
at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660)
at kafka.consumer.ZookeeperConsumerConnector.kafka$consumer$ZookeeperConsumerConnector$$reinitializeConsumer(ZookeeperConsumerConnector.scala:967)
at kafka.consumer.ZookeeperConsumerConnector.consume(ZookeeperConsumerConnector.scala:254)
at kafka.consumer.ZookeeperConsumerConnector.createMessageStreams(ZookeeperConsumerConnector.scala:156)
at org.apache.spark.streaming.kafka.KafkaReceiver.onStart(KafkaInputDStream.scala:111)
at org.apache.spark.streaming.receiver.ReceiverSupervisor.startReceiver(ReceiverSupervisor.scala:149)
at org.apache.spark.streaming.receiver.ReceiverSupervisor.start(ReceiverSupervisor.scala:131)
at org.apache.spark.streaming.scheduler.ReceiverTracker$ReceiverTrackerEndpoint$$anonfun$9.apply(ReceiverTracker.scala:597)
at org.apache.spark.streaming.scheduler.ReceiverTracker$ReceiverTrackerEndpoint$$anonfun$9.apply(ReceiverTracker.scala:587)
at org.apache.spark.SparkContext$$anonfun$33.apply(SparkContext.scala:1979)
at org.apache.spark.SparkContext$$anonfun$33.apply(SparkContext.scala:1979)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
at org.apache.spark.scheduler.Task.run(Task.scala:86)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
17/04/20 05:22:16 WARN TaskSetManager: Lost task 0.0 in stage 8.0 (TID 80, prd-mapr-node1.fishbowl.com): kafka.common.ConsumerRebalanceFailedException: OlapEventsJamba_appEvent_HOSTA-1492680125896-b52bf576 can't rebalance after 4 retries
at kafka.consumer.ZookeeperConsumerConnector$ZKRebalancerListener.syncedRebalance(ZookeeperConsumerConnector.scala:660)
at kafka.consumer.ZookeeperConsumerConnector.kafka$consumer$ZookeeperConsumerConnector$$reinitializeConsumer(ZookeeperConsumerConnector.scala:967)
at kafka.consumer.ZookeeperConsumerConnector.consume(ZookeeperConsumerConnector.scala:254)
at kafka.consumer.ZookeeperConsumerConnector.createMessageStreams(ZookeeperConsumerConnector.scala:156)
at org.apache.spark.streaming.kafka.KafkaReceiver.onStart(KafkaInputDStream.scala:111)
at org.apache.spark.streaming.receiver.ReceiverSupervisor.startReceiver(ReceiverSupervisor.scala:149)
at org.apache.spark.streaming.receiver.ReceiverSupervisor.start(ReceiverSupervisor.scala:131)
at org.apache.spark.streaming.scheduler.ReceiverTracker$ReceiverTrackerEndpoint$$anonfun$9.apply(ReceiverTracker.scala:597)
at org.apache.spark.streaming.scheduler.ReceiverTracker$ReceiverTrackerEndpoint$$anonfun$9.apply(ReceiverTracker.scala:587)
at org.apache.spark.SparkContext$$anonfun$33.apply(SparkContext.scala:1979)
at org.apache.spark.SparkContext$$anonfun$33.apply(SparkContext.scala:1979)
at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
at org.apache.spark.scheduler.Task.run(Task.scala:86)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
以下是我尝试解决问题的步骤
在consumer.props和zookeeper.props
中设置以下值zookeeper.connection.timeout.ms=1000000
zookeeper.session.timeout.ms=10000
rebalance.backoff.ms=10000
A和B都是telnet&ping和ping。
然后,我尝试打印主题消息的模式,但输出只是
root
Spark应用程序正在输出目录中创建一个_success文件。
以下是zookeeper日志的快照:
[2017-04-20 09:49:23,648] INFO Got user-level KeeperException when processing sessionid:0x15b8aa804290015 type:create cxid:0x79 zxid:0x1a1f txntype:-1 reqpath:n/a
Error Path:/consumers/test-group/owners/topic_test/0 Error:KeeperErrorCode = InvalidACL for /consumers/test-group/owners/topic_test/0 (org.apache.zookeeper.server.PrepRequestProcessor)
[2017-04-20 09:49:25,978] INFO Got user-level KeeperException when processing sessionid:0x15b8aa804290015 type:create cxid:0xea zxid:0x1a20 txntype:-1 reqpath:n/a
Error Path:/consumers/test-group/owners/topic_test/0 Error:KeeperErrorCode = InvalidACL for /consumers/test-group/owners/topic_test/0 (org.apache.zookeeper.server.PrepRequestProcessor)
[2017-04-20 09:49:28,320] INFO Got user-level KeeperException when processing sessionid:0x15b8aa804290015 type:create cxid:0x15b zxid:0x1a21 txntype:-1 reqpath:n/a
Error Path:/consumers/test-group/owners/topic_test/0 Error:KeeperErrorCode = InvalidACL for /consumers/test-group/owners/topic_test/0 (org.apache.zookeeper.server.PrepRequestProcessor)
[2017-04-20 09:49:30,653] INFO Got user-level KeeperException when processing sessionid:0x15b8aa804290015 type:create cxid:0x1cc zxid:0x1a22 txntype:-1 reqpath:n/a
Error Path:/consumers/test-group/owners/topic_test/0 Error:KeeperErrorCode = InvalidACL for /consumers/test-group/owners/topic_test/0 (org.apache.zookeeper.server.PrepRequestProcessor)
可能是什么问题?任何帮助表示赞赏。