File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
examples/src/main/python/streaming Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 22
22
To run this on your local machine, you need to setup Kafka and create a producer first
23
23
$ bin/zookeeper-server-start.sh config/zookeeper.properties
24
24
$ bin/kafka-server-start.sh config/server.properties
25
+ $ bin/kafka-topics.sh --create --zookeeper localhost:2181 --partitions 1 --topic test
25
26
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
26
27
27
28
and then run the example
28
- `$ bin/spark-submit --driver-class-path lib_managed/jars/kafka_*.jar: \
29
- external/kafka/target/scala-*/ spark-streaming-kafka_ *.jar examples/src/main/python/\
30
- streaming/kafka_wordcount.py localhost:2181 test`
29
+ `$ bin/spark-submit --driver-class-path external/kafka-assembly/target/scala-*/ \
30
+ spark-streaming-kafka-assembly- *.jar examples/src/main/python/streaming/kafka_wordcount.py \
31
+ localhost:2181 test`
31
32
"""
32
33
33
34
import sys
Original file line number Diff line number Diff line change @@ -73,10 +73,9 @@ def getClassByName(name):
73
73
except Py4JError , e :
74
74
# TODO: use --jar once it also work on driver
75
75
if not e .message or 'call a package' in e .message :
76
- print "No kafka package, please build it and add it into classpath:"
77
- print " $ sbt/sbt streaming-kafka/package"
78
- print " $ bin/submit --driver-class-path lib_managed/jars/kafka_2.10-0.8.0.jar:" \
79
- "external/kafka/target/scala-2.10/spark-streaming-kafka_2.10-1.3.0-SNAPSHOT.jar"
76
+ print "No kafka package, please put the assembly jar into classpath:"
77
+ print " $ bin/submit --driver-class-path external/kafka-assembly/target/" + \
78
+ "scala-*/spark-streaming-kafka-assembly-*.jar"
80
79
raise e
81
80
ser = PairDeserializer (NoOpSerializer (), NoOpSerializer ())
82
81
stream = DStream (jstream , ssc , ser )
You can’t perform that action at this time.
0 commit comments