【问题标题】:spark-submit on kubernetes cluster does not recognise k8s --master propertyKubernetes 集群上的 spark-submit 无法识别 k8s --master 属性
【发布时间】:2019-07-25 18:35:12
【问题描述】:

我已经成功安装了一个 Kubernetes 集群,可以通过以下方式进行验证:

C:\windows\system32>kubectl cluster-info
        Kubernetes master is running at https://<ip>:<port>
        KubeDNS is running at https://<ip>:<port>/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

然后我尝试使用从 https://spark.apache.org/downloads.html 下载的 Spark 运行 SparkPi。

spark-submit --master k8s://https://192.168.99.100:8443 --deploy-mode cluster --name spark-pi --class org.apache.spark.examples.SparkPi --conf spark.executor.instances=2 --conf spark.kubernetes.container.image=gettyimages/spark c:\users\<username>\Desktop\spark-2.4.0-bin-hadoop2.7\examples\jars\spark-examples_2.11-2.4.0.jar

我收到此错误:

Error: Master must either be yarn or start with spark, mesos, local
Run with --help for usage help or --verbose for debug output

我尝试了 2.4.0 和 2.3.3 版本。我也试过了

spark-submit --help

查看关于 --master 属性的信息。这是我得到的:

--master MASTER_URL         spark://host:port, mesos://host:port, yarn, or local.

根据关于在 Kubernetes 中运行 Spark 工作负载的文档 [https://spark.apache.org/docs/latest/running-on-kubernetes.html],spark-submit 似乎甚至无法识别主节点的 k8s 值。 [包括在可能的 Spark 大师中:https://spark.apache.org/docs/latest/submitting-applications.html#master-urls]

有什么想法吗?我会在这里错过什么?

谢谢

【问题讨论】:

    标签: apache-spark kubernetes


    【解决方案1】:

    问题是我的 CMD 正在识别我之前安装的 spark-submit 版本(2.2),即使我是从 spark 安装的 bin 目录运行命令。

    【讨论】:

      猜你喜欢
      • 2019-04-03
      • 2019-05-14
      • 2019-08-26
      • 1970-01-01
      • 1970-01-01
      • 2021-08-24
      • 1970-01-01
      • 2020-05-25
      • 2021-06-27
      相关资源
      最近更新 更多