【发布时间】:2020-06-11 05:10:46
【问题描述】:
我已经使用 SparkContext.stop() 或 sc.stop() 使用了以下 StackOverflow 问题中的可用答案。即使这样我也收到以下错误。该文件存在于指定的文件夹中。 1Cannot load main class from JAR file
【问题讨论】:
标签: apache-spark hdfs
我已经使用 SparkContext.stop() 或 sc.stop() 使用了以下 StackOverflow 问题中的可用答案。即使这样我也收到以下错误。该文件存在于指定的文件夹中。 1Cannot load main class from JAR file
【问题讨论】:
标签: apache-spark hdfs
要在集群模式下启动 Spark 应用程序,一般的 sintax 是
$ ./bin/spark-submit --class path.to.your.Class --master yarn --deploy-mode cluster [options] <app jar> [app options]
在您的情况下,最简单的方法是在您的项目目录下启动 spark-submit
$ cd /home/username/my_project
在此目录下,您应该有一个目标目录,该目录是您的 app.jar 所在的位置
$ ls target/
my_app.jar
作为如何启动 spark-submit 的示例
$ spark-submit \
--class example.KMeansCoords \
--name "KMeansCoords" \
--master yarn-client \
target/kmeans-1.0.jar \
/loudacre/devicestatus_etl/*
在哪里
--class <application.MainClass>
--name <name of your app>
--master <local, yarn, mesos....>
<path to your app.jar>
<options, resources like files to load in your app>
还有更多选择,您可以点击此链接了解更多详情
【讨论】: