将文件添加到 dataproc 上的 spark 驱动程序类路径文件

add file to spark driver classpath file on dataproc

我需要将配置文件添加到 google dataproc 上的驱动程序 spark 类路径。

我已经尝试使用 gcloud dataproc jobs submit spark--files 选项,但这不起作用。

有没有办法在 google dataproc 上做到这一点?

在 Dataproc 中,任何列为 --jar 的内容都将添加到类路径中,而列为 --file 的任何内容都将在每个 spark 执行程序的工作目录中可用。即使标志是 --jars,如果您需要将文件放在类路径中,将非 jar 条目放入此列表应该是安全的。

我知道,我回答得太晚了。为新访客发帖。

可以使用云执行此操作 shell。已经测试过了。

gcloud dataproc jobs submit spark --properties spark.dynamicAllocation.enabled=false --cluster=<cluster_name> --class com.test.PropertiesFileAccess --region=<CLUSTER_REGION> --files gs://<BUCKET>/prod.predleads.properties --jars gs://<BUCKET>/snowflake-common-3.1.34.jar