Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to run Kafka in spark

avatar

I am trying this command

spark-submit --master local[4] --class com.oreilly.learningsparkexamples.scala.KafkaInput $ASSEMBLY_JAR localhost:2181 spark-readers pandas 1

but i get the following error

Exception in thread "Thread-73" org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 0.0 failed 1 times, most recent failure: Lost task 0.0 in stage 0.0 (TID 0, localhost): java.lang.IllegalArgumentException: Missing required property 'groupid'

1 ACCEPTED SOLUTION

avatar
Guru

This sounds like it may be a build problem.

https://github.com/simonellistonball/spark-samples...

has a working sample with sbt scripts to build against the Hortonworks repository, which has been testing on HDP 2.3.2.

Note that the Kafka consumer API has changed a bit recently, so it's important to be aware of versions in Kafka.

Also, I note that you're running in local model, we would recommend that you only use local mode for testing, and that you use --master yarn-client for running on a proper cluster.

View solution in original post

5 REPLIES 5

avatar
Guru

This sounds like it may be a build problem.

https://github.com/simonellistonball/spark-samples...

has a working sample with sbt scripts to build against the Hortonworks repository, which has been testing on HDP 2.3.2.

Note that the Kafka consumer API has changed a bit recently, so it's important to be aware of versions in Kafka.

Also, I note that you're running in local model, we would recommend that you only use local mode for testing, and that you use --master yarn-client for running on a proper cluster.

avatar
Expert Contributor

@Simon Elliston Ball do you have a sample code for java?

avatar
Master Mentor

avatar
Expert Contributor

@Neeraj Sabharwalthanks that is a great tutorial but, that example is in scala as well.

avatar
Master Mentor