首页 > 解决方案 > 如何在 dcos spark run 中传递 jar 文件(来自 Artifactory)?

问题描述

我正在尝试在 DC/OS 平台上运行 spark 流作业,但我遇到了 kafka 包的问题。当我尝试使用以下--jars模式包含 Kafka 库及其依赖项(从 Maven 下载的 jar 文件,添加到工件并从那里读取)时:

dcos spark run --submit-args"--jars https://../../../spark-streaming 2.11-2.2.1.jar --conf spark.executor.memory=2g --py-files=https://../../../libs.zip,https://../../../test.py etc"

似乎 file libs.zip, test.py 被正确读取,但.jarfile 被省略。

知道为什么吗?这类问题有什么解决方法吗?

提前感谢您的帮助!

标签: jarpysparkdcosspark-submit

解决方案


I'm not sure why the dcos spark submit command doesn't support --jar option, but you can use the spark.mesos.uris property to download artifacts to the working directory of a Spark driver and executor.

I'm not sure how your Python-based Spark job is going to use JARs, but you may need setting the spark.executor.extraClassPath and spark.driver.extraClassPath configuration property as well.


推荐阅读