如何在kubernetes上使用GCP火花操作符运行spark-submit命令?

问题描述 投票:0回答:1

我有一个spark应用,我想在kubernetes上使用GCP spark操作器部署。https:/github.comGoogleCloudPlatformspark-on-k8s-operator。. 我能够使用命令kubectl apply -f example.yaml运行一个spark应用程序,但我想使用spark-submit命令,我有一个spark应用程序,我想在kubernetes上使用GCP spark operatorhttps:/github.comGoogleCloudPlatformspark-on-k8s-operator。

apache-spark kubernetes google-cloud-platform google-kubernetes-engine spark-submit
1个回答
0
投票

有几个选项提到的 https:/github.combig-data-europedocker-spark。 看看是否能解决你的问题。

kubectl run spark-base --rm -it --labels="app=spark-client" --image bde2020/spark-base:2.4.5-hadoop2.7 -- bash ./spark/bin/spark-shell --master spark://spark-master:7077 --conf spark.driver.host=spark-client

kubectl run spark-base --rm -it --labels="app=spark-client" --image bde2020/spark-base:2.4.5-hadoop2.7 -- bash ./spark/bin/spark-submit --class CLASS_TO_RUN --master spark://spark-master:7077 --deploy-mode client --conf spark.driver.host=spark-client URL_TO_YOUR_APP

0
投票

没有办法直接操作spark操作器将yaml配置文件翻译成spark特定选项和kubernetes资源时生成的spark-submit命令。这也是使用该操作符的一种意义。它可以让你使用yaml配置文件来运行SparkApplication或ScheduledSparkApplication,就像它是一个kubernetes资源一样。大多数选项可以通过配置地图中的hadoop或spark配置文件来设置,或者作为命令行参数设置到驱动和执行器pod中的jvm。我建议使用最后一种方法,以便在微调spark作业时有更多的灵活性。

© www.soinside.com 2019 - 2024. All rights reserved.