Configure Apache Spark for AWS EKS



我想开始在k8s上使用apache spark,但我没有使用它的经验。我通过带有ServiceType"的Helm图表安装了Spark;LoadBalancer";。

spark-submit --master 'spark://LOADBALANCER.elb.eu-central-1.amazonaws.com:7077'  
--deploy-mode client 
--conf spark.kubernetes.container.image='MY_IMAGE' test.py

这是我的测试代码test.py

from pyspark.sql import SparkSession
spark_session = SparkSession.builder 
.getOrCreate()
l = [('Alice', 1)]
spark_session.createDataFrame(l).show()

在microk8s集群上本地运行可以工作,但在AWS EKS集群上以相同的方式失败,并出现以下无休止的日志警告

22/02/16 17:36:01 INFO TaskSchedulerImpl: Adding task set 0.0 with 1 tasks resource profile 0
22/02/16 17:36:16 WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources

有没有一种方法可以开发用户代码并在kubernetes集群上运行它,或者我应该每次都创建一个新的docker映像?也许在EKS上有一些Apache Spark的最佳实践?

尝试更改为--deploy-mode cluster

最新更新