apache-spark - 如何在 GCP 中以集群模式运行 Spark 作业?
问题描述
在 GCP 中,我们希望在 data[proc 集群上以集群模式运行 spark 作业。目前我们正在使用以下命令:-
gcloud dataproc jobs submit spark --cluster xxxx-xxxx-dataproc-cluster01 --region us-west2 --xxx.xxxx.xxx.xxx.xxx.xxx.xxxx.xxxx --jars gs://xxx-xxxx-poc/cluster-compute/lib/xxxxxxxx-cluster-computation-jar-0.0.1-SNAPSHOT-allinone.jar --properties=spark:spark.submit.deployMode=cluster --properties=spark.driver.extraClassPath=/xxxx/xxxx/xxxx/ -- -c xxxxxxxx -a
但是,使用上述作业是在本地模式下提交的。我们需要在集群模式下运行。
解决方案
您可以通过指定以下内容以集群模式运行它--properties spark.submit.deployMode=cluster
在您的示例中, deployMode 看起来不正确。
--properties=spark:spark.submit.deployMode=cluster
看起来spark:
是多余的。
这是作业提交的完整命令
gcloud dataproc jobs submit pyspark --cluster XXXXX --region us-central1 --properties="spark.submit.deployMode=cluster" gs://dataproc-examples/pyspark/hello-world/hello-world.py
下面是集群模式下运行的作业截图
更新
要传递以下多个属性是 dataproc 作业提交
gcloud dataproc jobs submit pyspark --cluster cluster-e0a0 --region us-central1 --properties="spark.submit.deployMode=cluster","spark.driver.extraClassPath=/xxxxxx/configuration/cluster-mode/" gs://dataproc-examples/pyspark/hello-world/hello-world.py
运行下面的作业是显示 deployMode 是 Cluster 并且还设置了额外的类路径的屏幕截图
推荐阅读
- python - Python CSV读取然后将变量写入模板
- python - conda activate tensorflow2.3(python3.8) 注意:你可能需要重启内核才能使用更新的包
- c# - Azure KafkaTrigger 中的标头在哪里
- svelte - Sveltekit 基于文件夹的相对锚标记href
- microsoft-graph-api - 在将 Mircosoft graphClient 与 delta 查询一起使用时,onedrive 会抛出 Item not found 异常
- reactjs - 使用 Firebase 托管 React 下一个应用程序如何工作?
- ios - [GAIDataStore coordinatorWithModel:URL:]、[GAICoreDataUtil entityWithDescription:] 在 iOS 应用程序中出现崩溃
- python - 对python进行java调用并显示响应
- text-align - 选择器 { 文本对齐:“。” 正确的; }
- python - 为什么即使我在同一个函数中分配它,它也会显示“分配前引用的局部变量”?