【问题标题】:Spark + Mesos cluster mode, who uploads the jar?Spark + Mesos 集群模式,谁上传jar?
【发布时间】:2016-03-02 21:53:55
【问题描述】:

我正在尝试使用 Mesos 集群模式运行 Spark 应用程序。 (我已经让客户端模式工作,但仍想尝试集群模式)

我已经在 Mesos 主节点上启动了spark-mesos-dispatcher

当我使用以下命令在本地路径/tmp/assembly.jar 提交程序集时,

bin/spark-submit --master mesos://dispatcher:7077 --deploy-mode cluster --class com.example.Example /tmp/assembly.jar

失败是因为文件/tmp/assembly.jar在mesos从节点上不存在。

I1129 10:47:43.839771  5884 fetcher.cpp:414] Fetcher Info: {"cache_directory":"\/tmp\/mesos\/fetch\/slaves\/9d725348-931a-48fb-96f7-d29a4b09f3e8-S9\/deploy","items":[{"action":"BYPASS_CACHE","uri":{"extract":true,"value":"\/tmp\/assembly.jar"}}],"sandbox_directory":"\/var\/lib\/mesos\/slaves\/9d725348-931a-48fb-96f7-d29a4b09f3e8-S9\/frameworks\/9d725348-931a-48fb-96f7-d29a4b09f3e8-0291\/executors\/driver-20151129104742-0008\/runs\/31bf5840-226e-4b87-ae76-d14bd2f17950","user":"user"}
I1129 10:47:43.840710  5884 fetcher.cpp:369] Fetching URI '/tmp/assembly.jar'
I1129 10:47:43.840721  5884 fetcher.cpp:243] Fetching directly into the sandbox directory
I1129 10:47:43.840731  5884 fetcher.cpp:180] Fetching URI '/tmp/assembly.jar'
I1129 10:47:43.840737  5884 fetcher.cpp:160] Copying resource with command:cp '/tmp/assembly.jar' '/var/lib/mesos/slaves/9d725348-931a-48fb-96f7-d29a4b09f3e8-S9/frameworks/9d725348-931a-48fb-96f7-d29a4b09f3e8-0291/executors/driver-20151129104742-0008/runs/31bf5840-226e-4b87-ae76-d14bd2f17950/assembly.jar'
cp: cannot stat `/tmp/assembly.jar': No such file or directory
Failed to fetch '/tmp/assembly.jar': Failed to copy with command 'cp '/tmp/assembly.jar' '/var/lib/mesos/slaves/9d725348-931a-48fb-96f7-d29a4b09f3e8-S9/frameworks/9d725348-931a-48fb-96f7-d29a4b09f3e8-0291/executors/driver-20151129104742-0008/runs/31bf5840-226e-4b87-ae76-d14bd2f17950/assembly.jar'', exit status: 256
Failed to synchronize with slave (it's probably exited)

如果是 YARN 集群模式,Spark's YARN client implementation will upload the application jar to HDFS so that the driver and all executors have access to the jar,但我在 Mesos 或 Standalond 集群模式使用的 RestSubmissionClient 中找不到这样的代码。

在这种情况下,谁来上传?还是我需要手动将应用程序程序集放在可通过 HTTP URI 访问的地方?

【问题讨论】:

    标签: apache-spark mesos


    【解决方案1】:

    据我了解,您可以使用 SparkContext addJar() 方法添加本地(到驱动程序应用程序)JAR 文件路径,然后将其分发到执行程序节点(在客户端模式下)。

    当您声明要使用集群模式时,我建议您查看Spark Jobserver 项目,它应该使在 Mesos 上运行 Spark 应用程序比使用内置工具更容易。

    【讨论】:

    • 感谢您的建议,但我知道这些建议是做什么的,而您没有回答我的问题。我应该将此问题发送到 spark-user 邮件列表。
    猜你喜欢
    • 1970-01-01
    • 2015-12-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-27
    • 2021-01-04
    • 1970-01-01
    相关资源
    最近更新 更多