简体   繁体   English

Apache Kafka Cluster启动失败,并显示NoNodeException

[英]Apache Kafka Cluster start fails with NoNodeException

I'm trying to start a spark streaming session which consumes from a Kafka queue and I'm using Zookeeper for config mgt. 我正在尝试启动一个从Kafka队列消耗的Spark Streaming会话,并且我正在使用Zookeeper进行配置mgt。 However, when I try to start this following exception is being thrown. 但是,当我尝试启动此错误时,将引发以下异常。

18/03/26 09:25:49 INFO ZookeeperConnection: Checking Kafka topic core-data-tickets does exists ...

18/03/26 09:25:49 INFO Broker: Kafka topic core-data-tickets exists
18/03/26 09:25:49 INFO Broker: Processing topic : core-data-tickets
18/03/26 09:25:49 WARN ZookeeperConnection: Resetting Topic Offset
org.I0Itec.zkclient.exception.ZkNoNodeException: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /consumers/clt/offsets/core-data-tickets/4
    at org.I0Itec.zkclient.exception.ZkException.create(ZkException.java:47)
    at org.I0Itec.zkclient.ZkClient.retryUntilConnected(ZkClient.java:685)
    at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:766)
    at org.I0Itec.zkclient.ZkClient.readData(ZkClient.java:761)
    at kafka.utils.ZkUtils$.readData(ZkUtils.scala:443)
    at kafka.utils.ZkUtils.readData(ZkUtils.scala)
    at net.core.data.connection.ZookeeperConnection.readTopicPartitionOffset(ZookeeperConnection.java:145)

I have already created the relevant Kafka topic. 我已经创建了相关的Kafka主题。

Any insights on this would be highly appreciated. 任何对此的见解将不胜感激。

#

I'm using the following code to run the spark job 我正在使用以下代码来运行Spark作业

 spark-submit --class net.core.data.compute.Broker --executor-memory 512M --total-executor-cores 2 --driver-java-options "-Dproperties.path=/ebs/tmp/continuous-loading-tool/continuous-loading-tool/src/main/resources/dev.properties" --conf spark.ui.port=4045 /ebs/tmp/dev/data/continuous-loading-tool/target/continuous-loading-tool-1.0-SNAPSHOT.jar 

I guess that this error has to do with offsets retention. 我猜想这个错误与偏移量保留有关。 By default, offsets are stored for only 1440 minutes (ie 24 hours). 默认情况下,偏移量仅存储1440分钟(即24小时)。 Therefore, if the group has not committed offsets within a day, Kafka won't have information about it. 因此,如果该小组一天之内未提交补偿,Kafka将不会获得有关它的信息。

A possible workaround is to set the value of offsets.retention.minutes accordingly. 可能的解决方法是相应地设置offsets.retention.minutes的值。

offsets.retention.minutes 偏移量。保留时间。分钟

Offsets older than this retention period will be discarded 超过此保留期限的抵销将被丢弃

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM