我刚刚复制了 spark streaming wodcount python 代码,并使用 spark-submit 在 Spark 集群中运行 wordcount python 代码,但它显示以下错误:
py4j.protocol.Py4JJavaError: An error occurred while calling o23.loadClass.
: java.lang.ClassNotFoundException: org.apache.spark.streaming.kafka.KafkaUtilsPythonHelper
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
我确实构建了 jar spark-streaming-kafka-assembly_2.10-1.4.0-SNAPSHOT.jar。我使用以下脚本提交: bin/spark-submit /data/spark-1.3.0-bin-hadoop2.4/wordcount.py --master spark://192.168.100.6:7077 --jars /data/ spark-1.3.0-bin-hadoop2.4/kafka-assembly/target/spark-streaming-kafka-assembly_*.jar。
提前致谢!