Spark流kafka积分直接法eofexception

46qrfjad  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(369)

当我运行spark流示例时 org.apache.spark.examples.streaming.JavaDirectKafkaWordCount ,我抓到一个 EOFException 跟着,我怎么解决

Exception in thread "main" org.apache.spark.SparkException: java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
    at org.apache.spark.streaming.kafka.KafkaUtils$$anonfun$createDirectStream$2.apply(KafkaUtils.scala:413)
    at org.apache.spark.streaming.kafka.KafkaUtils$$anonfun$createDirectStream$2.apply(KafkaUtils.scala:413)
    at scala.util.Either.fold(Either.scala:97)
    at org.apache.spark.streaming.kafka.KafkaUtils$.createDirectStream(KafkaUtils.scala:412)
    at org.apache.spark.streaming.kafka.KafkaUtils$.createDirectStream(KafkaUtils.scala:528)
    at org.apache.spark.streaming.kafka.KafkaUtils.createDirectStream(KafkaUtils.scala)
xzabzqsa

xzabzqsa1#

直接流在下面使用一个低级别的kafka消费者,因此需要提供代理列表。很可能你还没有,所以你可能想设置 metadata.broker.list 窗体中的属性 bhost1:9092,bhost2:9092,...,bhostN:9092 .
另请参见kafka simpleconsumer无法连接到zookeeper:received-1(从通道读取时)。

相关问题