gpt4 book ai didi

java - Apache Kafka 集群启动失败并出现 NoNodeException

转载 作者:行者123 更新时间:2023-12-02 02:14:30 24 4
gpt4 key购买 nike

我正在尝试启动一个从 Kafka 队列消耗数据的 Spark 流 session ,并且我正在使用 Zookeeper 进行配置管理。但是,当我尝试启动时,会引发以下异常。

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)

我已经创建了相关的 Kafka 主题。

对此的任何见解都将受到高度赞赏。

#

我使用以下代码来运行 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

最佳答案

我猜这个错误与偏移量保留有关。默认情况下,偏移量仅存储 1440 分钟(即 24 小时)。因此,如果该组在一天内没有提交偏移量,Kafka 将不会有相关信息。

一个可能的解决方法是相应地设置 offsets.retention.months 的值。

<强> offsets.retention.minutes

Offsets older than this retention period will be discarded

关于java - Apache Kafka 集群启动失败并出现 NoNodeException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49488768/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com