gpt4 book ai didi

scala - AWS EMR 添加步骤 : How to add multiple jars from s3 in --jars and --driver-class-path options?

转载 作者:行者123 更新时间:2023-12-05 08:07:14 24 4
gpt4 key购买 nike

因此,我尝试使用 spark-submit 在 AWS EMR 上以 cluster 模式运行 Apache Spark 应用程序。如果我在类路径中只提供一个 jar,它可以很好地使用 --jar--driver-class-path 选项的给定选项。根据 EMR 的要求,我所需的所有依赖项 jar 都位于 S3 存储桶中。为此,我在 EMR AWS 控制台上的 EMR 添加步骤选项中使用以下命令:

--class org.springframework.boot.loader.JarLauncher --jars s3://emrb/gson-2.8.4.jar --driver-class-path s3://emrb/gson-2.8.4.jar

现在,我在 add stepspark-submit options 区域提供了这个选项。但是如果我想用同样的方式提供多个依赖的jar,它不会占用其他的jar。我提供了以下方式并尝试了各种选项,但找不到相关的 jar:

 --jars s3://emrb/hadoop_jars/emrfs-hadoop-assembly-2.32.0.jar,s3://emrb/gson-2.8.4.jar --driver-class-path s3://emrb/hadoop_jars/emrfs-hadoop-assembly-2.32.0.jar,s3://emrb/gson-2.8.4.jar --class org.springframework.boot.loader.JarLauncher

最佳答案

您可以在单独的 json 文件中指定步骤参数:

aws emr add-steps --cluster-id "j-xxx" --steps file://./steps.json

steps.json 包含如下内容:

[
{
"Type":"Spark",
"Args": [
"--jars",
"s3://emrb/hadoop_jars/emrfs-hadoop-assembly-2.32.0.jar,s3://emrb/gson-2.8.4.jar",
"--driver-class-path",
"s3://emrb/hadoop_jars/emrfs-hadoop-assembly-2.32.0.jar,s3://emrb/gson-2.8.4.jar",
"--class",
"org.springframework.boot.loader.JarLauncher"
]
}
]

关于scala - AWS EMR 添加步骤 : How to add multiple jars from s3 in --jars and --driver-class-path options?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55753938/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com