Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Spark Kafa createDirectStream failed while createStream successful

avatar
Explorer

I'm testing spark streaming from Kafka code from Spark example in HDP 2.4 and Spark 1.6.

I tried KafkaWordCount.scala example successful with

`$ bin/run-example org.apache.spark.examples.streaming.KafkaWordCount zoo01,zoo02,zoo03 my-consumer-group topic1,topic2 1`

But DirectKafkaWordCount.scala failed with below query and error

bin/run-example streaming.DirectKafkaWordCount broker1-host:port,broker2-host:port topic1,topic2

16/05/11 13:52:02 INFO SimpleConsumer: Reconnect due to socket error: java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
org.apache.spark.SparkException: java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
        at org.apache.spark.streaming.kafka.KafkaCluster$anonfun$checkErrors$1.apply(KafkaCluster.scala:366)
        at org.apache.spark.streaming.kafka.KafkaCluster$anonfun$checkErrors$1.apply(KafkaCluster.scala:366)
1 ACCEPTED SOLUTION

avatar
Explorer

It's a known issue for HDP 2.4 release, BUG-51292. And there is no workaround....

View solution in original post

3 REPLIES 3

avatar
Master Guru

This can have different reasons unfortunately I have seen the same error when using wrong hostnames ( not fully qualified, localhost instead of the full hostname ... ) I have also seen it in the context of security, i.e. when connecting to a kerberized kafka and providing a wrong jaas configuration, ...

First thing I would do is check the broker-host variable. Fully qualify it and see if that fixes anything.

avatar
Explorer

I'm using exactly the same broker list and topics in both command. So I think that won't be the cause.

avatar
Explorer

It's a known issue for HDP 2.4 release, BUG-51292. And there is no workaround....