1

当我运行火花流示例时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)
4

1 回答 1

1

直接流使用底层的 Kafka 消费者,因此需要提供代理列表。很可能你没有,所以你可能想metadata.broker.list在表单中设置属性bhost1:9092,bhost2:9092,...,bhostN:9092

另请参阅Kafka SimpleConsumer 无法连接到 zookeeper:从通道读取时收到 -1

于 2015-08-14T17:20:15.107 回答