簡體   English   中英

Apache Spark:spark 執行器 pod 無法從注冊表/存儲庫中提取 docker 圖像

[英]Apache Spark : spark executor pod isn't able to pull docker image from a registry/repo

我是 Apache Spark 的新手。

我正在嘗試使用pyspark 運行火花 session 我已經為它配置了 2 個執行器節點。 現在,兩個執行程序節點都需要拉取存儲庫中我自定義構建的 spark 映像。

下面是 python 中我的 spark 會話/工作的配置

spark = SparkSession.builder.appName('sparkpi-test1'
).master("k8s://https://kubernetes.default:443"
).config("spark.kubernetes.container.image", "\<repo\>"
).config("spark.kubernetes.authenticate.caCertFile", "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
).config("spark.kubernetes.authenticate.oauthTokenFile", "/var/run/secrets/kubernetes.io/serviceaccount/token"
).config("spark.kubernetes.authenticate.driver.serviceAccountName", "spark-driver-0"
).config("spark.executor.instances", 2
).config("spark.driver.host", "test"
).config("spark.driver.port", "20020"
).config("spark.serializer", "org.apache.spark.serializer.KryoSerializer"
).config("spark.sql.hive.convertMetastoreParquet", "false"
).config("spark.jars.packages", "org.apache.hudi:hudi-spark3.3-bundle_2.12:0.12.1,org.apache.spark:spark-avro_2.12:3.1.2"
).config("spark.kubernetes.node.selector.testNodeCategory", "ondemand"
).getOrCreate()

sparkpi-test1-2341a185c8144b60-exec-1 0/1
ImagePullBackOff 0 5h17m sparkpi-test1-2341a185c8144b60-exec-2 0/1
ImagePullBackOff 0 5h17m

所以,如果我做錯了什么,請糾正我。 我正在嘗試使用我在某些 repo 中自定義構建的 spark 圖像在我現有的 kube.netes 集群中設置 Spark。 我在我的 python 文件中提到了相同的配置。

.config("spark.kube.netes.container.image", "<repo>"

根據文檔

Container image to use for the Spark application. This is usually of the form example.com/repo/spark:v1.0.0. This configuration is required and must be provided by the user, unless explicit images are provided for each different container type.

為什么我的執行節點無法從注冊表中提取鏡像? 暫時如何為executor節點手動拉取呢?

僅供參考 查找以下錯誤信息

WARN TaskSchedulerImpl: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources

我猜上面的錯誤信息是因為我的executor pods沒有創建成功。

我懂了。 我正在使用 terraform 來構建所有資源。 .tfstate 文件已更改並導致 Pod 出現這些錯誤

清除 terraform 緩存解決了我的問題。

清理 terraform 緩存運行

rm -rf .terraform 

在你的 terraform 目錄中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM